1

Browserstack uses this uri http:/hub-cloud.browserstack.com/wd/hub. While locally I use a http://xxx.xxx.xx.xxx:xxxx/wd/hub. I have tried putting those in and I get an error I have also tried to get a Boolean for FI using Browserstack(which is the Browserstack setup code) so I have the following below. What should be in the 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!\"}}");
        }
HANSTKE
  • 47
  • 6

1 Answers1

0

The answer was to add

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.}
HANSTKE
  • 47
  • 6
  • Is this supposed to be C# code? It wouldn't compile for me. – Roy Cohen Sep 30 '21 at 18:30
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 30 '21 at 20:37
  • It is C# and should compile it works for me. the () was showing you can mark it for true or false. – HANSTKE Oct 01 '21 at 11:24