Closed gettingtired closed 5 years ago
Could you share your config please?
I have a selenium server (zalenium) hosted in aws.
{
"src_folders": [
"C:\\Users\\kcid\\nightwatch\\scripts"
],
"custom_commands_path": "C:\\Users\\nightwatch\\custom-commands",
"custom_assertions_path": "C:\\Users\\kcid\\nightwatch\\custom-assertions",
"waitForConditionPollInterval": 200,
"test_settings": {
"default": {
"selenium": {
"start_process": false,
"host": "selenium-docker.service.ccp.org",
"port": "4445"
},
"silent": true,
"disable_colors": true,
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"acceptInsecureCerts": true,
"elementScrollBehavior": 1
},
"request_timeout_options": {
"timeout": 300000
}
}
}
}
I was able to run tests after modifying nightwatch's /lib/protocol/transport.js
get defaultPathPrefix() {
return '/wd/hub';
}
Yes, I see the problem. You can also fix it by explicitly setting "default_path_prefix" : "/wd/hub"
in the "selenium"
settings, which should be set by default for selenium.
I see, that solves it.
Tried running my script on firefox and got this response from verbose logging. Selenium v3.11.0, Firefox v59.0.2, Nightwatch v1.0.4
Request POST http://selenium-docker:4445/wd/hub/session/8a183f25-3d58-436e-8ce5-b46af3c5c220/execute
{ script: 'return document.readyState;', args: [] }
Response 404 POST http://selenium-docker:4445/wd/hub/session/8a183f25-3d58-436e-8ce5-b46af3c5c220/execute (654ms)
{ value:
{ error: 'unknown command',
message: 'POST /session/8a183f25-3d58-436e-8ce5-b46af3c5c220/execute did not match a known command',
stacktrace: '' } }
Error while running .executeScript() protocol action: POST /session/8a183f25-3d58-436e-8ce5-b46af3c5c220/execute did not match a known command
Everything works on chrome as expected. I can put this in a separate issue.
This is exactly what I have been experiencing with nightwatch against Firefox + selenium.
@kmcid Please create a separate issue so that @beatfactor can see this issue more clearly :) Thanks!
Could you please verify this with v1.0.6?
@beatfactor So after v1.0.6, testing against firefox gives:
An occurred error while retrieving a new session
.
Settings:
"src_folders": [
"tests"
],
"output_folder": "./reports",
"page_objects_path": "./page-objects",
"webdriver": {
"default_path_prefix": "/wd/hub",
"ssl": true
},
"test_settings": {
"default": {
"selenium": {
"start_process": false,
"host": "selenium.xxx.com",
"port": 443
},
"desiredCapabilities": {
"browserName": "chrome"
}
},
"firefox": {
"desiredCapabilities": {
"browserName": "firefox",
"acceptInsecureCerts": true
}
}
}
This should be fixed in v1.0.12. Please open a new issue if the problem still persists.
@beatfactor It still persists. See my comment: https://github.com/nightwatchjs/nightwatch/issues/1874#issuecomment-438250024
Fetching session with nightwatch v0.9.20, selenium 3.11.0
Fetching session with v1.0.4, selenium 3.11.0
I can't seem to retrieve any session without the /wh/hub path