Closed nicolashery closed 9 years ago
I also have this issue. I didn't realize that it was a problem since I was just testing the library and thought I had used it incorrectly.
Hmm, any chance one of you could submit a failing spec? I can't reproduce this.
It failed on the spec provided in the sample docs ("I'm a kitty!"). I just copy and pasted it into a js file and ran it with mocha kitty.js
I did not add the BDD describe
and it
. Let me know if I can help.
/usr/lib/node_modules/selenium-webdriver/lib/webdriver/locators.js:243
throw new TypeError('Invalid locator');
^
TypeError: Invalid locator
at Function.webdriver.Locator.checkLocator (/usr/lib/node_modules/selenium-webdriver/lib/webdriver/locators.js:243:9)
at webdriver.WebDriver.findElements (/usr/lib/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:810:31)
at Function.all (/usr/lib/node_modules/chai-webdriver/node_modules/webdriver-sizzle/lib/webdriver_sizzle.js:22:19)
at assertElementExists (/usr/lib/node_modules/chai-webdriver/lib/index.js:18:16)
at Assertion.<anonymous> (/usr/lib/node_modules/chai-webdriver/lib/index.js:75:14)
at Assertion.ctx.(anonymous function) [as text] (/usr/lib/node_modules/chai/lib/chai/utils/addMethod.js:34:25)
at Object.<anonymous> (/home/nathaniel/programming/projects/js/tmoi/test/e2e/kitty.js:14:62)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
Sorry, still can't reproduce. Code copied and pasted from the readme works perfectly for me using selenium-webdriver@2.40.0
, run either directly with node or through mocha.
If you're still experiencing the problem, please submit a pull request with a failing spec in it. Thanks!
I just noticed something that may be related and thought I'd share. If your project depends on selenium-webdriver and chai-webdriver, this error can happen if your top-level version of selenium-webdriver gets out of sync with the chai-webdriver dependency selenium-webdriver.
FWIW I saw this issue with protractor, not chai-webdriver, but I believe the root cause is the same.
You might consider switching the selenium-webdriver dependency for chai-webdriver too a peer dependency. This means that the project using chai-webdriver will explicitly need to depend on selenium-webdriver but will ensure that chai-webdriver uses whatever version of selenium-webdriver the project is using.
http://blog.nodejs.org/2013/02/07/peer-dependencies/
On Sun, Dec 21, 2014 at 10:21 PM, Bob Zoller notifications@github.com wrote:
I just noticed something that may be related and thought I'd share. If your project depends on selenium-webdriver and chai-webdriver, this error can happen if your top-level version of selenium-webdriver gets out of sync with the chai-webdriver dependency selenium-webdriver.
FWIW I saw this issue with protractor, not chai-webdriver, but I believe the root cause is the same.
— Reply to this email directly or view it on GitHub https://github.com/goodeggs/chai-webdriver/issues/13#issuecomment-67805746 .
eat well with good eggs on: twitter http://twitter.com/goodeggs || facebook http://facebook.com/goodeggs || blog http://blog.goodeggs.com/
Oh hey! That would totally explain this issue. :+1:
Upgrading to:
chai-webdriver@0.5.3
selenium-webdriver@2.40.0
Gave me an error on all my tests:
Downgrading to:
chai-webdriver@0.5.3
selenium-webdriver@2.39.0
Works fine.
I'm not sure what happened in the latest release of
selenium-webdriver
, that introduced some breaking change?Thanks!