HomeSelenium

Setting up and Running Selenium 4 Automation Scripts on different browsers of Mac Machine (Selenium 4 – Session 10)


Downloading and configuring Selenium 4 WebDriver in Java Projects

Traditional Way – Normal Java Project


 
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 ChromeDriver 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 chrome driver
  8. Setting the Chrome Driver –
    System.setProperty (“webdriver.chrome.driver” ,“./drivers/chromedriver.exe” );
  9. Run the code to see the Chrome Browser launching.
  10. Running scripts on different browsers
  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