Debugging Browserstack

1,189 views
Skip to first unread message

Rob Wilkerson

unread,
Jun 10, 2014, 9:17:25 AM6/10/14
to nightw...@googlegroups.com
Running my tests against Browserstack, I'm running into an issue where a .waitForElementVisible() assertion is failing after an absurd amount of time (64 seconds in my last attempt). The element is present within a second, but never becomes visible (I need it visible so I can click on it). Is there any way to get screenshots so I can see what Browserstack is seeing? I tried enabling the screenshots option, but nothing shows up in my screenshots/ directory.

  "test_settings" : {
    "default" : {
      "launch_url" : "http://hub.browserstack.com",
      "selenium_host"  : "hub.browserstack.com",
      "selenium_port"  : 80,
      "silent": true,
      "screenshots" : {
        "enabled" : true,
        "path" : "screenshots"
      },
      "desiredCapabilities": {
        "browserName": "firefox",
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "browserstack.user": "USER",
        "browserstack.key": "KEY"
      }
    }
  }

Is there any way to see what Browserstack sees? Similarly, do I have something just flat out wrong in my settings?

Thanks.

Rob Wilkerson

unread,
Jun 10, 2014, 10:02:17 AM6/10/14
to nightw...@googlegroups.com
The verbose output from this test can be found at https://gist.github.com/robwilkerson/174561bc8a13364d255c. For whatever it's worth, since this may not be apples-to-apples, if I load the page directly in browserstack the element seems to display pretty quickly.

Andrei Rusu

unread,
Jun 13, 2014, 4:51:18 PM6/13/14
to nightw...@googlegroups.com
Screenshots are only generated automatically in case of an error generated by the selenium server. If you want to take a screenshot use saveScreenshot:

Looking at the logs according to selenium the element is not visible. Try another selector or element in the same page and check if it's an issue with that specific element that selenium doesn't realize it's visible?
Message has been deleted

Ashwin Gonsalves

unread,
Jun 14, 2014, 9:35:52 AM6/14/14
to nightw...@googlegroups.com
Hi Rob,

You can use the visual logs feature (setting the capability 'browserstack.debug'  =  'true') to automatically capture screenshots for every change that occurs on the web page as your test proceeds.

To debug any issues while running your test, you can use the ‘Interactive session’ link on the Automate dashboard - https://www.browserstack.com/automate. However, you need to keep sending a request (eg: get the page title and print it) at regular intervals so that your test session does not timeout (no activity from your test for more than 90 seconds).

Lastly, you can refer to the following link for explicitly generating screenshots - http://nightwatchjs.org/api/saveScreenshot.html

Ashwin @ BrowserStack

Rob Wilkerson

unread,
Jun 17, 2014, 8:01:28 AM6/17/14
to nightw...@googlegroups.com
Thanks, Ashwin. This is great information. I had gotten past my original issue, but am now seeing a connection error pop up in my tests:

There was an error while executing the Selenium command
Automate testing time expired.
ERROR Response 500 POST /wd/hub/session{ value: {}, sessionId: '', status: 13 }
Connection refused! Is selenium server started?

I'd like to try using this interactive session to see if there's any additional information, but I don't see that link/option/reference. I'm logged in and looking at https://www.browserstack.com/automate. Can you point me in the right direction?

Rob Wilkerson

unread,
Jun 17, 2014, 8:04:58 AM6/17/14
to nightw...@googlegroups.com
Never mind, Ashwin. I see the problem. Thanks again for the info.
Reply all
Reply to author
Forward
0 new messages