Handling Timeouts on Automate sessions
Learn about the different timeouts like Idle Timeout, SO Timeout and Session Limit Reached on BrowserStack Automate and their possible resolutions.
The following timeouts may appear in the STOP_SESSION logs of your sessions:
Idle timeout
The default time interval that BrowserStack waits for a command is set to 90 seconds. If no new command reaches the BrowserStack hub after the previous command was served, the session ends with BROWSERSTACK_IDLE_TIMEOUT
. You can increase the timeout using the capability idleTimeout
. Example:
If you are using BrowserStack SDK, you can set the following capabilities in the browserstack.yml
file:
idleTimeout: 300
You can use either Selenium 4 or Selenium Legacy JSON to organize your tests.
BrowserStack SDK is a plug-n-play solution that takes care of all the integration steps for you. Using the BrowserStack SDK is the recommended integration method for your project. To know more, visit the SDK core concepts page.
"browserstack.idleTimeout": 300
It may also be the case, that all commands in your script have run but driver.quit
was not received at the end of the session. In such cases, the session will end with BROWSERSTACK_IDLE_TIMEOUT
because BrowserStack cannot detect if the test has ended.
You can read more about other possible causes of IDLE TIMEOUT and the different ways to resolve them.
SO timeout
Socket timeouts or SO_TIMEOUT
happen when the browser becomes unresponsive for a period of 240 seconds post which, the unresponsive browser is killed, changing the session status to ERROR on the Automate dashboard.
The browser could have become unresponsive for several reasons, including but not limited to unhandled pop-ups. We recommend you to go through the session’s video where you have observed SO_TIMEOUT and see whether there is any unhandled pop-up in the active window.
While in most cases, it is seen that this is a one-off issue but, if you have been facing this issue repeatedly, then we suggest you reach out to BrowserStack Support with the details of the problem, and we would be happy to help you out.
Session limit reached
BrowserStack Automate supports session durations up to 2 hours. If a session is running for more than 7200 seconds (2 hours), the session is stopped, changing the session status to TIMEOUT on the dashboard.
To avoid such a scenario, you can divide your test into multiple smaller tests which can then run on their individual sessions. This timeout might also be caused when your test framework misbehaves. In any such scenario, you can always choose to stop the session manually from the Automate dashboard.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!