How to setup Selenium WebDriver with TestNG, JUnit, Maven & ReportNG in Eclipse

I have seen this question posted in many forums "How to setup Selenium WebDriver with TestNG" or just "How to setup Selenium WebDriver in Eclipse", and I have also seen many good articles suggesting step by step information on how to setup Selenium 2.0 (WebDriver) with Eclipse but never seen some directly providing Java project with all the details.

I have tried creating one simple setup which includes Eclipse and with Selenium 2.0 WebDriver Java project. Java project has following plug-ins installed, you can use them as per your requirements in your test automation project.

Zip includes following:
  1. Eclipse IDE for Java and DSL Developers - Downloaded it from, and it has following plugins already added.
    1. Maven 
    2. TestNG 6.1.
  2. Java project with following libs added in Maven pom.xml
    1. Selenium 2.0 (Java WebDriver) 2.44.0
    2. JUnit 3.8.1
    3. ReportNG 1.1.4 
    4. Guice 3.0
If you want to use some other eclipse version and if you want similar setup for that eclipse version then please let me know, I will be very happy to provide / build setup for you.

To Download with all above mentioned plug-ins & Java Project, please click on below image.
 You have two options, If you don't have eclipse already on your computer then just unzip the eclipse and when you will open eclipse by clicking on "../eclipse/eclipse.exe" file, it will ask you to provide  workspace: You can provide the directory path where you have extracted the above zip file.

If you look at the below scheen shot, I have extracted zip file under "C:\diiinnovation", and in this case I would provide same "C:\diiinnovation" as my eclipse workspace.
Once you provide Workspace, and when eclipse opens, you will see java project as shown below:
You might have to change few things in eclipse like JRE version of Java project. Above setup created using JRE 1.8 version, if your computer doesn't have JRE 1.8 installed then after installing above setup, you have to change JRE version which is already present in your computer for the selenium default project.

Refer "How to change JRE version of your Java project in Eclipse" post for more details.

If you are planning to use TestNG, then by default TestNG reporting is enabled.

If you are planning to use ReportNG then please refer "How to use ReportNG with TestNG for HTML Reporting" post (point # B, C & D)

One more thing, in above default Java project you will see libraries used with some specified version, if you want to use other version than mentioned above (may be latest available) then you just have to open "pom.xml" file present in the Java project and just update the library version... your project will get updated automatically with new/latest libs.

Please let me know if you have any problem running eclipse, or even don't hesitate to contact in case of questions or concerns.

If you want to know how to setup Java project with all above plug ins (in case if you don't want to use default provided java project) then also please let me know, I will help you... or if you can search "How to configure eclipse with selenium" in google search, you will find many posts.

Thanks for visiting, and hope to see you again.

Good luck!
Related Posts Plugin for WordPress, Blogger...
Powered by Blogger