2

Обновление Selenium 3.0.1 вызывает ошибку при вызове узла через файл конфигурации Json. Пожалуйста, найдите следующие данные из файла Json.Selenium 3.0.1 Конфигурация Chrome Node

{ 
    "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 Config: обнаружен файл конфигурации выделенного узла. пожалуйста, обновите файл для работы с селеном 3

ответ

0

Если посмотреть на сообщении об ошибке (полной которую вы не включили сюда)

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.

1

Я уверен, что вы решили эту проблему, но и для будущих посетителей:

В Селене 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" }