Recommend using the start Using Selenium 4 repo. This repo is for Selenium 3
This repo is deprecated and based on WebDriver 3
Source code to support getting started using Selenium WebDriver with Java
The source code has only really been uploaded in case people encounter problems following the instructions or make a very simple mistake that they cannot figure out.
Please read the comments below, and the source code comments if you are having trouble starting work with Firefox.
- First install Java, Maven and IntelliJ
- Second install Firefox, GeckoDriver, Chrome and ChromeDriver
If you are on a mac and have allowed Remote Execution in the Safari browser then you can use the command line:
mvn test -Dtest=MyFirstSafariTest
If you are using Chrome and have added ChromeDriver to the path then use the command line:
mvn test -Dtest=MyFirstChromeTest
If you are using Firefox and have added GeckoDriver to the path then use the command line:
mvn test -Dtest=MyFirstTest
Do not run mvn test
because some of the tests are Platform and WebDriver version dependant and at least one will probably fail.
You may also wish to edit the pom.xml
file and change the version of Selenium WebDriver to the current version listed on seleniumhq.org in the downloads section
Author: Alan Richardson
If you are using Chrome and have added ChromeDriver to the path then use the command line:
mvn test -Dtest=MyFirstChromeTest
If you are using Firefox and have added GeckoDriver to the path then use the command line:
mvn test -Dtest=MyFirstTest
If you wish to use earlier versions of Firefox then see the repo:
https://github.com/eviltester/startUsingLegacyFirefoxWebDriver