The Nightwatch tests in my company started failing when run locally with Chrome on some computers (we're all using Mac OS). After further investigation I found out that Nightwatch couldn't locate input elements when Chrome was updated to the latest Version 65.0.3325.146 (Official Build) (64-bit).
I created a quick example here, where I go to the Google website, type in Hello world!, click submit and wait for the Google logo not to be present. The test fails in Chrome v65 but passes in Firefox. Here is the output of npm test --verbose:
[Nightwatch Test] Test Suite
================================
Running: first
โ Element <#hplogo> was visible after 45 milliseconds.
ERROR: Unable to locate element: "input.lsb[type=button]" using: css selector
at Object.first (/Users/daniel/code/nightwatch-test/tests/nightwatch-test.js:8:14)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
โ Timed out while waiting for element <#hplogo> to be removed for 5000 milliseconds. - expected "not found" but got: "found"
at Object.first (/Users/daniel/code/nightwatch-test/tests/nightwatch-test.js:9:14)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
FAILED: 1 assertions failed, 1 errors and 1 passed (9.995s)
_________________________________________________
TEST FAILURE: 1 error during execution, 1 assertions failed, 1 passed. (10.073s)
โ nightwatch-test
- first (9.995s)
Timed out while waiting for element <#hplogo> to be removed for 5000 milliseconds. - expected "not found" but got: "found"
at Object.first (/Users/daniel/code/nightwatch-test/tests/nightwatch-test.js:9:14)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
npm verb lifecycle [email protected]~test: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~test: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/daniel/code/nightwatch-test/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
npm verb lifecycle [email protected]~test: CWD: /Users/daniel/code/nightwatch-test
npm info lifecycle [email protected]~test: Failed to exec test script
npm ERR! Test failed. See above for more details.
npm verb exit [ 1, true ]
npm verb code 1
Node v6.11.2
Nightwatch v0.9.20
Mac OS 10.13.3
Just found out, it is a Selenium issue: https://github.com/SeleniumHQ/selenium/issues/5576
Chrome v65 only supports chrome driver v2.36. Running the Selenium server with selenium-standalone start --drivers.chrome.version=2.36 solves the issue.
@dcastil Just curious. Have you moved to the latest chromeDriver version? I had this problem with chromedriver 2.33 and the move to 2.36 solved the issue.
Yes, as I said, with 2.36 it works fine again. ๐
Nice to know.
When I had replied, that message only mentioned the following, hence the question.
'Just found out, it might be a Selenium issue: SeleniumHQ/selenium#5576'
FYI @vvo
selenium-standalone install --drivers.chrome.version=2.36
selenium-standalone start --drivers.chrome.version=2.36
๐ฅ
๐ Kinda lost but if you need changes in selenium-standalone go for it :)
I am not able to setValue in chrome using nightwatch. I am using the version of chrome as 65.0.3325.146
Updating to and using chromedriver >= 2.36 solved for me. Thanks!
My project introduce the selenium-download NPM package,
so I upgrade "selenium-download": "^2.0.7" to "selenium-download": "^2.0.12" and upgrade jdk from 1.7 to 1.8 solve this problem, Thanks!
Upgrading the chromedriver to 2.36 solved this issue for me too ๐
Most helpful comment
Just found out, it is a Selenium issue: https://github.com/SeleniumHQ/selenium/issues/5576
Chrome v65 only supports chrome driver v2.36. Running the Selenium server with
selenium-standalone start --drivers.chrome.version=2.36solves the issue.