Browserstack使用这个uri http:/hub-cloud.browserstack.com/wd/hub。而在本地,我使用http://xxx.xxx.xx.xxx:xxxx/wd/hub。我试过把那些在,我得到一个错误,我也试图得到一个布尔值FI使用Browserstack(这是Browserstack设置代码),所以我有以下内容。if (Location)
应该包含哪些内容?if (Location)
{
var foundElement = (_IOSdriver.FindElementsByXPath(elementXPath));
Assert.IsNotNull(foundElement);
// Browserstack Check;
}
else
{
IReadOnlyList<IOSElement> allTextViewElements =
_IOSdriver.FindElementsByXPath(elementXPath);
//Setting the status of test as 'passed' or 'failed' based on the condition if results are found for the search
if ((allTextViewElements.Count > 0))
{
((IJavaScriptExecutor)_IOSdriver).ExecuteScript("browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed", "reason": " Results found! "}}");
}
else
{
((IJavaScriptExecutor)_IOSdriver).ExecuteScript("browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed", "reason": " Results not found!"}}");
}
答案是添加
var isbrowserstackrunning =false;
if (isBrowserstackrunning !=true)
{local stuff here including the capabilities you use locally}
else
{BrowserStack here including the capabilities you use for Browserstack.}