Selenium 4 Setup With Java, Maven, Eclipse | Install And First Test | Selenium 4 Installation
Introduction:
Selenium, the popular open-source automation testing tool, has been widely adopted by testers and developers around the world. With the recent release of Selenium 4, exciting new features and improvements have been introduced to enhance the testing experience. In this blog post, we will guide you through the setup process of Selenium 4 with Java, Maven, and Eclipse, and demonstrate how to perform your first test using this latest version.
You can also watch the video for completing the setup:
Prerequisites: Before we begin, make sure you have the following prerequisites in place:
Step 1: Create a Maven Project, let's create a new Maven project in Eclipse:
Step 2: Add Selenium 4 Dependency.
Now that we have our project set up, we need to add the Selenium 4 dependency to our project's pom.xml file:
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.10.0</version> </dependency>
Note: At the time of writing this blog post, Selenium 4 is at version 4.10.0. Make sure to check for any updates and use the latest stable version available.
7. Save the pom.xml file to update the project's dependencies.
Step 3: Set Up Test Case
Let's now create a simple test case to verify our Selenium 4 setup:
import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver;
Step 4: Run the Test
Finally, let's run our Selenium 4 test case:
Congratulations! You have successfully set up Selenium 4 with Java, Maven, and Eclipse.
Categories: : Selenium WebDriver Java