HomeSelenium

Setting up and Running Selenium 4 Automation Scripts on different browsers of Windows machine (Selenium 4 – Session 9)


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:
  1. Create a new Java Project
  2. Create a new Class say Demo having main() method
  3. Create an object for EdgeDriver Class
  4. Create a new folder say ‘libraries’ inside the Project workspace
  5. Download latest stable version of Selenium from Selenium.dev
  6. Extract the folder and Paste the available jar files into the library folder and configure the Project
  7. Create a new folder ‘drivers’ and copy the compatible edge driver
  8. Setting the Edge Driver –
    System.setProperty(“webdriver.edge.driver” ,”./drivers/edgedriver.exe” );
  9. Run the code to see the Edge Browser launching.
  10. Running scripts on different browsers – Firefox, Chrome and Opera
  11. 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

  1. Create a Maven Project
  2. Add the required dependencies to pom.xml
  3. Running the scripts on different browsers

By,
Arun Motoori

Comments (0)

Leave a Reply

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

For FREE Testing Tutorials & Videos

X
Open chat
Contact Us on Whatsapp