LambdaTest-Learning / selenium-manager-demo

This simple repo shows how to use Selenium Manager (in Selenium 4.7) with Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This simple example demonstrates how to use Selenium Manager in Selenium 4.6 (and above). For the demonstration, I have made use of Selenium 4.11.0

What is Selenium Manager

Selenium Manager is a new tool that helps to get a working environment to run Selenium out of the box.

Available with Selenium v4.6 (and above), it automatically configures the browser drivers for Chrome, Firefox, Internet Explorer, and Edge.

More information about Selenium Manager is available in the following locations:

How to use Selenium Manager in Java

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.11.0</version>
</dependency>

Execution

Here is all what is needed to instantiate the browsers:

  • Chrome ------> WebDriver driver = new ChromeDriver();
  • Firefox ------> WebDriver driver = new FirefoxDriver();
  • Edge --------> WebDriver driver = new EdgeDriver();

For demonstration, I used the getInstance method in SeleniumManager to print the location where the respective browser drivers are downloaded:

VS_IDE_Selenium_Manager_2

On execution, the browser drivers are downloaded in /Users/applemacbook_pro/.cache/selenium folder. These would be re-downloaded in case there is any update in the browser version.

CMD_Selenium_Manager

About

This simple repo shows how to use Selenium Manager (in Selenium 4.7) with Java

License:MIT License


Languages

Language:Java 100.0%