Selenium 3.0.1 Chrome Node configuration

别说谁变了你拦得住时间么 提交于 2019-12-06 09:26:27

I'm sure you've solved this, but for future visitors:

In Selenium 3, the configuration object has been flattened, as stated here: https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-json

So you just need to remove configuration. So something like this:

{ "capabilities": [ { "browserName": "chrome", "maxInstances": 5, "seleniumProtocol": "WebDriver" } ], "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", "maxSession": 5, "port": 5559, "host": ip, "register": true, "registerCycle": 5000, "hubPort": 4445, "hubHost":ip, "hub":"http://XX.XX.XX.XX:XXXX/grid/register", "timeout":600000, "browserTimeout":600000" }

If you look at the complete error message (which you haven't included here)

Exception in thread "main" org.openqa.grid.common.exception.GridConfigurationException: Error with the JSON of the config : Deprecated -nodeConfig file encountered. Please update the file to work with Selenium 3. See https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-json for more details. at org.openqa.grid.internal.utils.configuration.GridNodeConfiguration.loadFromJSON(GridNodeConfiguration.java:311) at org.openqa.grid.internal.utils.configuration.GridNodeConfiguration.loadFromJSON(GridNodeConfiguration.java:287) at org.openqa.grid.selenium.GridLauncherV3$3.setConfiguration(GridLauncherV3.java:261) at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:147) at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:73) Caused by: org.openqa.grid.common.exception.GridConfigurationException: Deprecated -nodeConfig file encountered. Please update the file to work with Selenium 3. See https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-json for more details. at org.openqa.grid.internal.utils.configuration.GridNodeConfiguration.loadFromJSON(GridNodeConfiguration.java:303) ... 4 more

you would realise that the error message also contains info on what you need to do to fix the problem.

Looks like they changed the file format of the node configuration file with 3.0.

Please refer here for a new sample file and here for more information.

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