Steps to Launch the ChromeBrowser without using chromedriver.exe



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”, “/path/to/binary/chromedriver”);
System.setProperty(“webdriver.gecko.driver”, “/path/to/binary/geckodriver”);
System.setProperty(“webdriver.opera.driver”, “/path/to/binary/operadriver”);
System.setProperty(“phantomjs.binary.path”, “/path/to/binary/phantomjs”);
System.setProperty(“webdriver.edge.driver”, “C:/path/to/binary/MicrosoftWebDriver.exe”);
System.setProperty(“webdriver.ie.driver”, “C:/path/to/binary/IEDriverServer.exe”);

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.

4 comments on “Steps to Launch the ChromeBrowser without using chromedriver.exe

  1. Vinay

    I have added a WebDriverManager jar file into my project and i have modified the code but wen i run my pom.xml file
    i am getting an error “org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
    null” could pls help me in solving this issue?
    org.apache.maven.plugins
    maven-surefire-plugin
    3.0.0-M3

    Reply

Leave a Reply

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