【问题标题】:Selenium 3.0.1 Chrome Node configurationSelenium 3.0.1 Chrome 节点配置
【发布时间】:2016-10-28 17:24:07
【问题描述】:

Selenium 3.0.1 更新在通过 Json 配置文件调用节点时抛出错误。请从 Json 文件中找到以下详细信息。

{
  "capabilities":
      [
        {
          "browserName": "chrome",
          "maxInstances": 5,
          "seleniumProtocol": "WebDriver"
        }
      ],
  "configuration":
  {
    "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"
  }
}

错误 - 配置的 Json 出错:遇到了已弃用的节点配置文件。请更新文件以使用 selenium 3

【问题讨论】:

    标签: selenium selenium-webdriver selenium-chromedriver selenium-grid


    【解决方案1】:

    我相信你已经解决了这个问题,但是对于未来的访问者:

    在 Selenium 3 中,configuration 对象已被展平,如下所述:https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-json

    所以你只需要删除configuration。所以是这样的:

    { "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" }

    【讨论】:

      【解决方案2】:

      如果您查看完整的错误消息(此处未包含)

      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

      您会意识到错误消息还包含有关您需要采取哪些措施来解决问题的信息。

      看起来他们用 3.0 更改了节点配置文件的文件格式。

      请参考here 获取新的示例文件,here 了解更多信息。

      【讨论】:

        猜你喜欢
        • 2017-05-23
        • 1970-01-01
        • 1970-01-01
        • 2017-02-28
        • 2020-02-11
        • 2014-04-24
        • 1970-01-01
        • 1970-01-01
        • 2020-06-14
        相关资源
        最近更新 更多