anabellaspinelli
3/28/2017 - 4:57 AM

Setting up Selenium with Java, Maven, Eclipse and Mac

Setting up Selenium with Java, Maven, Eclipse and Mac

Initial Steps

  1. Install Java and JDK
  2. Setup JAVA_HOME
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
  1. Download and install Maven (follow instructions in the maven readme file)
  2. Download Firefox (or any other supported browser)
  3. Download its driver (in Firefox's case, GeckoDriver).
  4. Install Eclipse/IntelliJ IDEA
  5. Create JAVA Project, Package, etc
  6. Create a pom.xml as instructed by Selenium docs on the project's root
  7. From the command line, run mvn clean install on the project's root
  8. Wait a while
  9. Download Selenium JAR File, add it to the project
    1. Right click on package
    2. Build Path > Configure > Libraries > Add external JARs
    3. This should make all the imports in the following step work
  10. Copy demo test file from Selenium docs
  11. Try to run it from Eclipse
  12. Google your heart out when it doesn't quite work

Useful Links