Is there a way too prevent selenium automatically terminating idle sessions?

…衆ロ難τιáo~ 提交于 2019-11-29 16:52:14

This error message...

INFO [ActiveSessions$1.onStop] - Removing session 70a1b8cbae6876cde7e66df13b3942d1 (org.openqa.selenium.chrome.ChromeDriverService)

...implies that the already initiated/spawned a new Chrome Browser Session was terminated.

This issue is observed with Selenium Grid Hub/Node configuration and/or RemoteWebdriver implementation.

If you observe the -help of selenium-server-standalone-x.y.z.jar the default -timeout / -sessionTimeout is set to 1800 seconds.

  • CLI Command:

    $>java -jar selenium-server-standalone-3.14.0.jar -help
    
  • Output:

-timeout, -sessionTimeout: <Integer> in seconds : Specifies the timeout before the server automatically kills a session that hasn't had any activity in the last X seconds. The test slot will then be released for another test to use. This is typically used to take care of client crashes. For grid hub/node roles, cleanUpCycle must also be set.

  • Default value: 1800

  • Snapshot:

Hence, you see the time out and it appears selenium automatically kills the browser session after ~30 minutes of not being called.


Solution

You can increase the -timeout / -sessionTimeout as follows:

$>java -jar /path/to/selenium-server-standalone-3.14.0.jar -sessionTimeout 57868143
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!