How To Setup a Selenium WebDriver Maven Project in Eclipse ?



Pre-requisite
  • To use Eclipse for Java programming, you need to first install Java Development Kit (JDK). Read How to Install JDK for Windows.

  • Before the start, please check if you have the Eclipse IDE installed on your system. If it’s not there on your system, then please install it from the following Link: https://www.eclipse.org/downloads/

  • For your note, there are different versions of Eclipse available like the Windows-32/64 bit, Linux, and MAC OS X operating systems. Hence, download the latest version of Eclipse that suits your system configuration.
  • After the completion of the previous step, locate and start the “eclipse.exe” from the folder where you’d saved the Eclipse binary. And define a path for the “Workspace” which you’ll be using to setup Selenium Webdriver project.
 
Create a new Project

  
1. Add a New Java Project in Eclipse IDE

Open Eclipse IDE, as described in the above steps and select “Project” from the list of project types to create a new module.
This project will get automatically saved to the Workspace that you would have specified previously.


2. Now select Maven project from wizard
 


3. Tick the <Create a Simple Project (skip archetype selection)> checkbox and click Next.
 
  
4. Fill the group id, artifact id, and name. And click the Finish button to create the project.




  
5. The project structure would look something like the one shown in the below image.
 




6. Also, you must make sure that the Installed JRE setting is correctly pointing to a JDK path on your system. You can change it from the Preferences window.
 



7. Every maven project uses a POM file to add the required dependencies. So we’ll also be adding some libs required for our Webdriver maven project. Namely, these are the Selenium and TestNG JAR files. Please check from the below screenshot.
Note: Make sure you provide the correct version for each dependency you add in the POM.


This way we create Selenium Maven Project in Eclipse.
Keep Learning

Popular posts from this blog

Let's kick start your Selenium Test Automation Framework To Generate Test Reports (TestNG,Extent Report)

How to do Custom Extent Report Version 4.0 in TestNG Framework ?

How to install Maven on Eclipse IDE ?

Let's Start Automation in Kotlin..!

How Robotic Process Automation Transforms the Software Testing Industry.

What is TestNG ?