using WebDriverManager class in Selenium WebDriver

      No Comments on using WebDriverManager class in Selenium WebDriver



Selenium WebDriver automation tool is mainly useful to run tests against multiple Browsers such as Chrome Browser,Firefox Browser,Internet Explorer Driver.Running the tests against multiple browsers is known as Cross Browser Testing.
To launch the Browser in Selenium WebDriver we need to set the path of the executable available in the laptop. Following that we have to instantiate the driver instance based on the Driver instance. In order to avoid these steps we can use the WebDriverManager class.

WebDriverManager

WebDriverManager allows to automate the management of the binary drivers (e.g. chromedriver, geckodriver, etc.) required by Selenium WebDriver.
Using WebDriverManager its not required to maintain the below lines of the code for launching the browser.

System.setProperty(“webdriver.chrome.driver”, “executable path”);
System.setProperty(“webdriver.gecko.driver”, “executable path”);
System.setProperty(“webdriver.opera.driver”, “executable path”);
System.setProperty(“phantomjs.binary.path”, “executable path”);
System.setProperty(“webdriver.edge.driver”, “executable path”);
System.setProperty(“webdriver.ie.driver”, “executable path”);

WebDriverManager Maven Depdendency

To use the WebDriverManager class ensure the following depedency is added in the maven project object model (pom.xml) file.


Like our Facebook Page to get frequent updates->

https://www.facebook.com/totalqa


Selenium WebDriver Code

Execute the below code in eclipse and verify the results.

Leave a Reply

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