2

I am running Automated Selenium tests in Browserstack my tests sometimes fail due to below error

Session timed out because the browser was idle for 90 seconds

In Browserstack settings, they have mentioned

IDLE TIMEOUT
If a session is idle for more than 90 seconds, the session is stopped, changing the session status to TIMEOUT on the dashboard.

But I cannot find a way to change this. Can anyone tell me how can I change this timeout?

Muhammad Hassan
  • 14,086
  • 7
  • 32
  • 54
  • @AlaEddineJEBALI `IDLE TIMEOUT` in browserstack is universal constant and it is not in our control according to their support team. I changed my code in order to tackle this problem. Thanks – Muhammad Hassan Jan 09 '17 at 05:47

4 Answers4

4

You cannot change the IDLE Timeout duration for sessions on BrowserStack Automate. If you have a specific use case and need to increase the duration, I'd suggest contacting their support team.

gb007
  • 64
  • 1
2

It should be because you missed to add driver.quit() in your test.

The driver.quit statement is required, otherwise the test continues to execute, leading to a timeout.

Ala Eddine JEBALI
  • 7,033
  • 6
  • 46
  • 65
2

You can configure the value for BROWSERSTACK_IDLE_TIMEOUT by specifying the capability 'browserstack.idleTimeout' in your test scripts as mentioned below

**"browserstack.idleTimeout" : "300"**

Note: The default value is 90 seconds. The maximum duration that can be specified is 300 seconds.

Alternatively, you can execute dummy commands in the test script to keep the session active such as:

thread.sleep(50000);
driver.getTitle();
thread.sleep(50000);
driver.getTitle();
0

https://www.browserstack.com/docs/automate/selenium/error-codes/browserstack-idle-timeout#python

capabilities = {
 "browserstack.idleTimeout": "300"
}
Vítek
  • 1
  • 1
  • Hi and thanks for the answer. Your answer would be much more valuable to us if you added an explanation about what your code does and why it helps the OP – Simas Joneliunas Feb 01 '22 at 05:57