Eclipse + Selenium Java + TestNG Project Setup step by step instructions are provided below. YouTube video with detail explanation also provided at the end of this tutorial.
 
Software used are listed below;
 
Eclipse 4.6.x
JDK 1.8.x
Selenium Java WebDriver 3.4.0
Chrome Driver 2.29
TestNG 6.10

 
Step 1: Download and Install Eclipse
Go to below link and download latest Eclipse software and Install it. If you download Zip file of the software, just unzip it and place it in C Drive. You are ready to use Eclipse.

http://www.eclipse.org/downloads/eclipse-packages/

Step 2: Download and Install JDK
Go to below link and download latest JDK (Java Development Kit). Java Development Kit is SDK which includes JRE (Java Runtime Environment) which is needed for executing the code.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Step 3: Install Maven and TestNG Plugins

Go to Eclipse -> Help – > Eclipse Marketplace and search for Maven and TestNG. Install the plugins. Eclipse will restart as part of plugin installation.

Step 4: Add Selenium & TestNG Dependency in Maven (pom.xml)

Open pom.xml and add dependencies and repository details as below; Then save the pom.xml and right click -> Run as – > Maven Build (with compile as goal)
Maven will automatically download and setup all the jars required for Selenium Java and TestNG framework.


  4.0.0
  TestingProject
  TestingProject
  0.0.1-SNAPSHOT
  
  
	  
	    jcenter
	    bintray
	    http://jcenter.bintray.com
	  
 
  
  
  	
  		org.seleniumhq.selenium
  		selenium-java
  		3.4.0
  	
  	
	  org.testng
	  testng
	  6.10
	  test
	 	  	
  

Step 6: Download and copy chrome browser driver

Go to seleniumhq.org website and download Chrome Browser driver. Copy the exe file in to project folder src/main/resources.

Finally the project should look as below;


Refer YouTube tutorial with detailed explanation

For further reading refer Java Selenium Programming Category posts.

Eclipse + Selenium Java + TestNG Maven Project Setup
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *