Environment Setup for Selenium WebDriver with Java
In this tutorial, we will set up a project for Selenium with Java programming language.
- JDK and JRE installed. (Download and install JDK )
- JAVA_PATH set as an environment variable on your system
- Eclipse IDE or IntelliJ, or Visual Studio code
- MAVEN installed and setup on the system
- GIT installed and configured on the system
- TestNG plugin installed in your IDE
To install the TestNG plugin in Eclipse, follow the following steps –
- Navigate to Help >> Market Place
- Search for “TestNG” and select “TestNG for Eclipse”
- Click Install, accept the license
- Restart the Eclipse.
Maven project setup on Eclipse —
- Open Eclipse, create a new project (File >> New)
- Select Maven project, click Next
3. Select “Create a simple project” and click Next.
4. Enter Group Id; this is your organization id. Example — “com.qatechhub”
5. Enter artefact Id; this is the name of your project. Example — “LearningSelenium”. Click Finish
6. Next step, right-click “JRE System Library” >> properties >> change “execution environment” to JDK 11 (or the latest version). Apply and close.
7. In pom.xml, copy and paste the below dependencies and save. This will download the libraries and dependencies in your project.
<!-- https://mvnrepository.com/artifact/org.testng/testng --><dependency>
This complete the project setup. We have created a MAVEN project, added all the dependencies required into this project.
If you have any question or query. Feel free to reach out to email@example.com