-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Meta -
OS: OSX 10.11.4
Selenium Version: 2.53.1
Browser: Firefox
Browser Version: 45.0.2
Expected Behavior -
When I use selenium-webdriver/remote's SeleniumServer class to create a grid hub and start() it, I should get a promise which resolves into the server address for the hub.
Actual Behavior -
When I start() the SeleniumServer, the process hangs for 30 seconds (or however long I've configured the timeout) before throwing this error:
/path/to/project/node_modules/selenium-webdriver/lib/promise.js:654
throw error;
^
Error: Timed out waiting for the WebDriver server at http://127.0.0.1:4444/wd/hub
at Error (native)
at onError (/path/to/project/node_modules/selenium-webdriver/http/util.js:87:11)
at ManagedPromise.invokeCallback_ (/path/to/project/node_modules/selenium-webdriver/lib/promise.js:1343:14)
at TaskQueue.execute_ (/path/to/project/node_modules/selenium-webdriver/lib/promise.js:2868:14)
at TaskQueue.executeNext_ (/path/to/project/node_modules/selenium-webdriver/lib/promise.js:2851:21)
at /path/to/project/node_modules/selenium-webdriver/lib/promise.js:2730:27
at /path/to/project/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:379:9)
Steps to reproduce -
1. Create a grid hub
const remote = require("selenium-webdriver/remote");
let options = { "args": [ "-role", "hub", "-hubConfig", config_path ], "loopback": true, "port": 4444 },
hub = new remote.SeleniumServer(jar_path, options);
The hub config file looks like this:
{
"port": 4444,
"maxSession": 1
}
2. Start the hub
hub.start()
.then(function (hub_addr) {
console.log("Selenium grid hub started: %s", hub_addr);
});
3. Check the console
Immediately after starting the hub, open a browser and load http://localhost:4444/grid/console. Click the "view config" link there. This is the output I see:
Config for the hub :
host : null
port : 4444
cleanUpCycle : 5000
timeout : 300000
browserTimeout : 0
newSessionWaitTimeout : -1
grid1Mapping : {}
throwOnCapabilityNotPresent : true
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
prioritizer : null
servlets :all params :
browserTimeout : 0
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
cleanUpCycle : 5000
host : null
hubConfig : /path/to/project/config/selenium_grid_hub.json
jettyMaxThreads : -1
maxSession : 1
newSessionWaitTimeout : -1
nodePolling : 5000
port : 4444
prioritizer : null
role : hub
servlets : []
throwOnCapabilityNotPresent : true
timeout : 300000Config details :
hub launched with :-port 4444 -role hub -hubConfig /path/to/project/config/selenium_grid_hub.json
the final configuration comes from :
the default :
host : null
port : 4444
cleanUpCycle : 5000
timeout : 300000
browserTimeout : 0
newSessionWaitTimeout : -1
grid1Mapping : {}
throwOnCapabilityNotPresent : true
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
prioritizer : null
servlets :all params :
browserTimeout : 0
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
cleanUpCycle : 5000
host : null
jettyMaxThreads : -1
maxSession : 5
newSessionWaitTimeout : -1
nodePolling : 5000
port : 4444
prioritizer : null
servlets : []
throwOnCapabilityNotPresent : true
timeout : 300000updated with grid1 config :No grid1 file specified. To specify one, use -grid1Yml XXX.yml where XXX.yml is a grid1 config file
updated with grid2 config : /path/to/project/config/selenium_grid_hub.json
host : null
port : 4444
cleanUpCycle : 5000
timeout : 300000
browserTimeout : 0
newSessionWaitTimeout : -1
grid1Mapping : {}
throwOnCapabilityNotPresent : true
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
prioritizer : null
servlets :all params :
browserTimeout : 0
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
cleanUpCycle : 5000
host : null
jettyMaxThreads : -1
maxSession : 1
newSessionWaitTimeout : -1
nodePolling : 5000
port : 4444
prioritizer : null
servlets : []
throwOnCapabilityNotPresent : true
timeout : 300000updated with params :
host : null
port : 4444
cleanUpCycle : 5000
timeout : 300000
browserTimeout : 0
newSessionWaitTimeout : -1
grid1Mapping : {}
throwOnCapabilityNotPresent : true
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
prioritizer : null
servlets :all params :
browserTimeout : 0
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
cleanUpCycle : 5000
host : null
hubConfig : /path/to/project/config/selenium_grid_hub.json
jettyMaxThreads : -1
maxSession : 1
newSessionWaitTimeout : -1
nodePolling : 5000
port : 4444
prioritizer : null
role : hub
servlets : []
throwOnCapabilityNotPresent : true
timeout : 300000
4. Wait 30 seconds
After waiting the length of the selenium server default timeout (30 seconds) I see the error message printed above.