https://npm.im/selenium-standalone doesn't work with recent versions of JDK and will cause Nightwatch to explode.
- Install JDK version 8
- Add this to your shell's profile:
export JAVA_HOME=/usr/libexec/java_home -v 1.8
- Restart shell
cd ~/Your Project
yarn add -D selenium-standalone
selenium-standalone install
selenium-standalone start
- Nightwatch tests should work.
Download/install the following from their websites in whatever order:
- Latest JDK
- Latest Selenium Standalone Server
- Latest chromedriver
Run this command:
java -Dwebdriver.chrome.driver=/absolute/path/to/chromedriver -jar /absolute/path/to/selenium-server-standalone-3.12.0.jar
Now your Nightwatch tests should work with Chrome.
Sorry, added a huge
OR
to the instructions. Use one method or the other.selenium-standlone
lives innode_modules
and makesselenium-standalone install
available.selenium-standalone install
will install all the drivers to their respective folders innode_modules/selenium-standalone/.selenium
, butselenium-standalone
doesn't work with JDK 10, so you need to make sure you're using JDK 8 (not sure if 9 works—didn't test it—but 8 works and 7 should).If you're referring to the Java Preferences under System Preferences, then I didn't see anywhere you could tweak
$JAVA_HOME
in it. I did see a lot of stuff about certs and I suspect certs might be why JDK 10 wasn't working, but didn't test on anhttp
site.I think Java will initially handle setting
$JAVA_HOME
, but if you happen to install JDK 10, then install 8, I don't think it overwrites it ($ java
will still refer to 10), so it's safer to instruct people to just manually do it on the chance they did install 10 before 8.Updated to refer to yarn rather than npm (but this gist can help people other than us, so I'd like to leave in the adding part).