nightwatch: Doesn't work with selenium v3.5.0 (but works with v.3.4.0)
Thanks for awesome library!
We recently tried to use nighwatch with remote selenium(runs on modern.ie Windows env) When we tried to use nightwatch with selenium v3.5.0, nightwatch not works correctly. response looks like below.
[Sample Test] Test Suite
==========================
Running: some tests
INFO Request: POST http://192.168.99.100:4444/wd/hub/session
- data: {"desiredCapabilities":{"browserName":"internet explorer","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","allowBlockedContent":true,"ignoreProtectedModeSettings":true,"name":"test"}}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":204}
INFO Response 200 POST http://192.168.99.100:4444/wd/hub/session (2223ms) { status: 0,
sessionId: '8bc6d284-222b-487b-9bfb-13e1b1039233',
value:
{ acceptInsecureCerts: false,
browserName: 'internet explorer',
browserVersion: '11',
pageLoadStrategy: 'normal',
platformName: 'windows',
'se:ieOptions':
{ browserAttachTimeout: 0,
elementScrollBehavior: 0,
enablePersistentHover: true,
'ie.browserCommandLineSwitches': '',
'ie.ensureCleanSession': false,
'ie.fileUploadDialogTimeout': 3000,
'ie.forceCreateProcessApi': false,
ignoreProtectedModeSettings: true,
ignoreZoomSetting: false,
initialBrowserUrl: 'http://localhost:39519/',
nativeEvents: true,
requireWindowFocus: false },
setWindowRect: true,
unhandledPromptBehavior: 'dismiss' } }
INFO Got sessionId from selenium 8bc6d284-222b-487b-9bfb-13e1b1039233
INFO Request: POST http://192.168.99.100:4444/wd/hub/session/8bc6d284-222b-487b-9bfb-13e1b1039233/url
- data: {"url":"http://10.0.2.2/"}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":30}
INFO Response 200 POST http://192.168.99.100:4444/wd/hub/session/8bc6d284-222b-487b-9bfb-13e1b1039233/url (1556ms) { state: 'success',
sessionId: null,
hCode: 24164963,
value: null,
class: 'org.openqa.selenium.remote.Response',
status: 0 }
LOG → Completed command url (1558 ms)
INFO Request: POST http://192.168.99.100:4444/wd/hub/session/8bc6d284-222b-487b-9bfb-13e1b1039233/elements
- data: {"using":"css selector","value":"body"}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":39}
INFO Response 200 POST http://192.168.99.100:4444/wd/hub/session/8bc6d284-222b-487b-9bfb-13e1b1039233/elements (264ms) { state: 'success',
sessionId: null,
hCode: 14282023,
value: [ { 'element-6066-11e4-a52e-4f735466cecf': '20953718-0db8-4133-86d1-7245e5ba3ef4' } ],
class: 'org.openqa.selenium.remote.Response',
status: 0 }
INFO Request: GET http://192.168.99.100:4444/wd/hub/session/8bc6d284-222b-487b-9bfb-13e1b1039233/element/undefined/displayed
- data:
- headers: {"Accept":"application/json"}
ERROR Response 500 GET http://192.168.99.100:4444/wd/hub/session/8bc6d284-222b-487b-9bfb-13e1b1039233/element/undefined/displayed (76ms) { state: 'stale element reference',
sessionId: null,
hCode: 14596883,
value:
{ additionalInformation: '\nDriver info: driver.version: unknown',
localizedMessage: 'Error setting arguments for script\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html\nBuild info: version: \'3.5.0\', revision: \'8def36e068\', time: \'2017-08-10T23:00:22.093Z\'\nSystem info: host: \'IE11WIN7\', ip: \'192.168.99.100\', os.name: \'Windows 7\', os.arch: \'x86\', os.version: \'6.1\', java.version: \'1.8.0_144\'\nDriver info: driver.version: unknown',
supportUrl: 'http://seleniumhq.org/exceptions/stale_element_reference.html',
systemInformation: 'System info: host: \'IE11WIN7\', ip: \'192.168.99.100\', os.name: \'Windows 7\', os.arch: \'x86\', os.version: \'6.1\', java.version: \'1.8.0_144\'',
cause: null,
suppressed: [],
message: 'Error setting arguments for script\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html\nBuild info: version: \'3.5.0\', revision: \'8def36e068\', time: \'2017-08-10T23:00:22.093Z\'\nSystem info: host: \'IE11WIN7\', ip: \'192.168.99.100\', os.name: \'Windows 7\', os.arch: \'x86\', os.version: \'6.1\', java.version: \'1.8.0_144\'\nDriver info: driver.version: unknown',
hCode: 32286113,
class: 'org.openqa.selenium.StaleElementReferenceException',
buildInformation: null },
class: 'org.openqa.selenium.remote.Response',
status: 10 }
But when we try same test case with Selenium 3.4.0, it works as expected.
Is nightwatch compatible with selenium v3.5.0 or not?
[IEDriverServer changelog] https://github.com/SeleniumHQ/selenium/blob/master/cpp/iedriverserver/CHANGELOG
this line looks like suspicious for me …
To successfully use this version of the IE driver, you should be using
version 3.5 or above of the language bindings. Those are the only versions
of language bindings that will understand the payload required to be sent
during the creation of a new session. Earlier versions of the language
bindings are not guaranteed to be fully compatible with this release of
the IE driver.
nightwatch.json(only relevant section)
{
"src_folders" : ["__tests__/nightwatch/test"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : false
},
"test_settings" : {
"default" : {
"launch_url" : "http://10.0.2.2",
"selenium_port" : 4444,
"selenium_host" : "192.168.99.100",
"silent": true,
"desiredCapabilities": {
"browserName": "internet explorer",
"javascriptEnabled": true,
"acceptSslCerts": true,
"allowBlockedContent": true,
"ignoreProtectedModeSettings": true
}
},
"ie" : {
"desiredCapabilities": {
"browserName": "internet explorer",
"javascriptEnabled": true,
"acceptSslCerts": true,
"allowBlockedContent": true,
"ignoreProtectedModeSettings": true
}
}
}
}
Sample tests
module.exports = {
'should close modal when click close button': (browser) => {
browser
.url('http://10.0.2.2/xxx')
.waitForElementVisible('body', 1000)
.end()
}
}
Versions
Nightwatch version: 0.9.16 Node.js version: v7.10.0 OS version: Windows 7 Enterprise SP1 (modern.ie / Virtualbox) Browser version: Internet Explorer 11 (v11.0.9600.17420) selenium-server-standalone version: v3.5.0 IEDriverServer version: v3.5.0(Win32)
Env
192.168.99.100:4444 -> selenium-standalone-server 10.0.2.2:80 -> Web server (at Virtualbox host)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 26 (1 by maintainers)
I really wish there were somewhere that listed the Nightwatch/Selenium/Chromedriver version compatibilities. It’s becoming obvious that there are only specific combinations that work; but that info isn’t well documented. This and this are the best I can find. 😕
Nightwatch Selenium > v3.5.0, use Nightwatch v0.9.19 Selenium =< v3.4.0, use Nightwatch v0.9.16
Selenium / ChromeDriver Compatibility
Selenium Client version 2.53.1 - Supports ChromeDriver v2.35
ChromeDriver / Chrome Compatibility
ChromeDriver v2.35 - Supports Chrome v62-64 ChromeDriver v2.34 - Supports Chrome v61-63 ChromeDriver v2.33 - Supports Chrome v60-62 ChromeDriver v2.32 - Supports Chrome v59-61 ChromeDriver v2.31 - Supports Chrome v58-60 ChromeDriver v2.30 - Supports Chrome v58-60 ChromeDriver v2.29 - Supports Chrome v56-58 ChromeDriver v2.28 - Supports Chrome v55-57 ChromeDriver v2.27 - Supports Chrome v54-56 ChromeDriver v2.26 - Supports Chrome v53-55 ChromeDriver v2.25 - Supports Chrome v53-55 ChromeDriver v2.22 - Supports Chrome v49-52 ChromeDriver v2.20 - Supports Chrome v43-48
This is fixed in v0.9.19.
Same with selenium 3.6.0. & geckodriver 0.19 The browser can open a url but can’t interact or find any elements. chromedriver works fine
Same for me, works fine with Chrome, but doesn’t work with Firefox. It opens the browser, you can see application well, but any kind of conditions are failing.
A update list for chrome -> chromedriver compatibility can always be found here: https://sites.google.com/a/chromium.org/chromedriver/downloads
Hi. To these one:
geckodriver 0.17.0 Firefox 54.0 Selenium v.3.4.0
I’ll add to this that with Selenium 3.5.x, even though Nightwatch (0.9.16) commands seem to work fine in Chrome, the chromedriver (2.32) process doesn’t get released when the Nightwatch tests are done.
Selenium 3.4.0 does seem to do better with Firefox (56, with marionette/geckodriver 0.18.0) but there are some things that still don’t work with it (e.g.
getLog(),moveToElement()/moveTo(),keys()).