Downloading and configuring Selenium 4 WebDriver in Java Projects
Traditional Way – Normal Java Projects
Follow the below steps for downloading and configuring the Selenium WebDriver in a Java Project:
-
Create a new Java Project
-
Create a new Class say Demo having main() method
-
Create an object for EdgeDriver Class
-
Create a new folder say ‘libraries’ inside the Project workspace
-
Download latest stable version of Selenium from Selenium.dev
-
Extract the folder and Paste the available jar files into the library folder and configure the Project
-
Create a new folder ‘drivers’ and copy the compatible edge driver
-
Setting the Edge Driver –System.setProperty(“webdriver.edge.driver” ,”./drivers/edgedriver.exe” );
-
Run the code to see the Edge Browser launching.
-
Running scripts on different browsers – Firefox, Chrome and Opera
-
Assigning the objects of the Browser Classes to the WebDriver Interface and creating a script which executes the scripts on different browsers based on the specified browser.
Real Time Way – Maven Project – WebDriverManager
-
Create a Maven Project
-
Add the required dependencies to pom.xml
-
Running the scripts on different browsers
By,
Arun Motoori