Unable to perform parallel execution on safari on mac using selenium

北战南征 提交于 2021-01-29 08:00:34

问题


I have around 1600 java TCs written using selenium. While executing test scripts in parallel (say thread count = 5), I am able to trigger 5 safari webdrivers and scripts are executing parallel.

But, when the 6th (threadcount +1) script gets invoked, it is throwing below exception:

Could not create a session: The Safari instance is already paired with another WebDriver session.

I am quitting and closing the webdriver session after each test case. The same piece of code is working fine for other browsers except safari.It should run on the same machine with 5 instances running parallel.


回答1:


My expectation is that you're hitting default maxSession limit of 5 browser instances.

You can double check it by opening your Selenium Grid console and looking into node configuration:

The value can be ramped up by providing the relevant maxSession parameter to your Selenium Grid Node startup command line like:

java -jar selenium-server-standalone-3.141.59.jar -role node -maxSession 10 -hub http://localhost:4444/grid/register
                                                             ^^^^^^^^^^^^^^

References:

  • Selenium Grid
  • Selenium Grid - Configuring the nodes - Optional Parameters
  • How to run your Selenium tests in Distributed Test Execution Environments


来源:https://stackoverflow.com/questions/57670744/unable-to-perform-parallel-execution-on-safari-on-mac-using-selenium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!