Thursday, 24 March 2016

Selenium installation set up in Intellij IDEA Maven project

Maven is one of the most popular build management systems in the Java world. In this article, you will learn how you can set up a selenium project using Maven in Intellij IDEA.

The tools you will need are -

  1. JDK - You can know more about JDK installation process in Windows on Softpost Java Tutorial
  2. Intellij IDEA IDE - Community Edition (It's free)
  3. Maven (It's free)
In latest versions of Intellij IDEA (15.0.4+) , maven comes built-in So you do not need to download it separately.

Below Images will guide you through the steps for creating the maven project.

Step 1 - Click on New Project menu in Intellij IDEA and then select Maven Project and Archetype


Step 2- Type in Group Id and Artifact Id for you project.
Step 3 - Provide the maven home directory and if you like you can also override maven settings


Step 4 - Type in the name of the project and project directory.

Step 5 - Your sample maven project will look like below.



Step 6 - Your sample POM.xml file will look like below. To use Selenium API, you will need to add Selenium dependency as shown in below image. We are using selenium version 2.53.0


Step 7 - Write sample Junit test to launch Firefox browser and execute using shortcut key Ctrl+shift+F10 or you can also right click on the code and click on Run.


Step 8 - You can also execute any maven phase like clean, validate, compile, test etc using Maven project window. 






What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com

No comments:

Post a Comment

Buy Best Selenium Books

Contributors