Here, we'll be installing all the prerequisites you need to get started with Selenium test automation in Java.
Create a free TestModeller.io account
Install the Java Development Kit – NOTE: The example framework targets Java 8 only out of the box.
Download it from here and follow the associated instructions
Install an IDE for editing Java code – We like to use IntelliJ editor, but Eclipse is also fine.
Download IntelliJ from here
Install ChromeDriver (this needs to match the version of chrome you will be executing your tests on) and make sure you add it to your system PATH.
Install Maven – this is used to manage the build process of our automation framework.
Download our example Java framework (if you don't have your own).
You can download the framework from out GitHub repo here.
Test It's Working
Make sure to restart the Terminal or Command line prompt to load the new environment variables.
Run mvn -v. You should see something like below:
Run sample automation library
Navigate to the Java framework directory (this should contain the pom.xml file).
Run mvn test. You should see some basic login tests execute against the Magento webstore.
Execution on other web browsers…
In this tutorial, we will be executing our tests on Google Chrome. You can use Firefox driver and Internet Explorer driver available from the Selenium website if you wish to interchange chrome for either of these browsers and beyond.