Selenium Webdriver Appium Complete TutorialSelenium Webdriver Appium Complete Tutorial
Automation Testing
  • Tools
    • Selenium
      • Selenium Java Tutorial
      • Selenium C# Tutorial
    • Appium
      • Appium Java Tutorial
      • Appium C#Tutorial
    • Katalon
  • Trainings
  • TestNG
  • Reports
    • Extent Reports
      • Extent Reports – Java
      • Extent Reports – Java -Version3
      • Extent Reports – C#
    • Vigo Reports
    • AT Excel Report
  • Excel
    • Apache POI – Java
    • Excel With C#
  • Interview Questions
    • Selenium Interview Questions
    • Java Interview Questions
    • C# Interview Questions
  • Demo Site
  • Practice Site
  • More…
    • AutoIt
    • Sikuli
    • Robot Class
    • File Upload
    • ScreenShot
      • AShot
      • ShutterBug
  • About
October 15, 2018

No More Driver EXE files for Selenium Execution – Instead Use WebDriverManager





Why do we use executable files for Launching browser using selenium?

After selenium 3, We got habituated to download exe files like chrome.exe, geckodriver.exe etc. to launch browsers. All these executable files are standalone server executable files that implements JSON-wire protocol and works as a glue between the test script and Browsers.

Most often, when we have updates of our browser, we have to update exe files as well to implement JSON-wire Protocol. So, All the time We need download updated EXE files and we need to update our repository.

We have an alternate to escape from those hurdles with Webdriver Manager Library.

Web Driver Manager Reference Link:

https://github.com/bonigarcia/webdrivermanager




Advantages of WebdriverManager :

  1. No need to download the chrome.exe,geckodriver.exe files etc..
  2. No need to set driver exe file path in selenium program
  3. No need to bother about the latest version of browser and exe files
  4. So, no issues with browser updates and exe files

To start with it, add below maven dependency or download jar files from here:

 
<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>3.0.0</version>
    <scope>test</scope>
</dependency>

Syntax:

WebDriverManager.chromedriver().setup();

Above syntax will download chromedriver exe file in run time during your program. For first time it takes a while to launch your browser.

Sample Program:

public class WebDriverManagerDemo
 {
	public static void main(String[] args)
    {
		WebDriverManager.chromedriver().setup();
		WebDriver driver = new ChromeDriver();
		driver.get("http://automationtesting.in");
	}
}





Is it possible to Download Particular version of Browser using WebDriverManager?

Yes, it’s possible to download particular version using Webdrivermanager.

Syntax:

  1. chromedriver().version(“2.26”).setup()
  •  Above syntax will download 2.26 version of chrome driver.
  1. firefoxdriver().arch32().setup()
  • Using Above syntax you will be able to download 32 bit Firefox driver.

Sample Program with ChromeDriver Version 2.26:

 
public class WebDriverManagerDemo
 {
	public static void main(String[] args) 
    {
		WebDriverManager.chromedriver().version("2.26").setup();
		WebDriver driver = new ChromeDriver();
		driver.get("http://automationtesting.in");
	}
}

Above program will download the 2.26 version of chromedriver exe file and used the same to launch the browser.

 

Please watch YouTube video for better understanding.

– This blog written by SUBBARAYUDU DARISIPUDI.



Share this post: on Twitter on Facebook on Google+

Katalon Analytics – Introduction How to Take Screenshot using Selenium ShutterBug

Related Posts

TAKING WEB ELEMENT SCREENSHOT IN SELENIUM

Selenium - Java

How to Capture WebElement Screenshot in Selenium Webdriver using selenium 4

avoid Switch to window

Selenium - Java

How to Avoid Switch To Window in Selenium WebDriver

HANDLE TEXTBOXES IN SELENIUM

Selenium - Java

Handling Textboxes in Selenium

JAVASCRIPTEXECUTOR IN SELENIUM

Selenium - Java

JavaScriptExecutor in Selenium

ELEMENT NOT VISIBLE EXCEPTION

Selenium - C#, Selenium - Java

Selenium ElementNotVisibleException

NOSUCHWINDOW EXCEPTIONS

Selenium - C#, Selenium - Java

Selenium NoSuchWindowException

NOSUCHFRAME EXCEPTIONS

Selenium - C#, Selenium - Java

Selenium NoSuchFrameException

NOSUCHELEMENT EXCEPTION

Selenium - C#, Selenium - Java

Selenium NoSuchElementException

SELENIUM WEBDRIVER EXCEPTIONS

Selenium - C#, Selenium - Java

Selenium WebDriver Exceptions

HANDLING BASIC ELEMENTS IN SELENIUM

Selenium - C#, Selenium - Java

Handling Basic Elements in Selenium

Newsletter

Recent Posts

  • TAKING WEB ELEMENT SCREENSHOT IN SELENIUMHow to Capture WebElement Screenshot in Selenium Webdriver using selenium 4
    December 15, 2019
  • How To SWAP Two Numbers in Java Without using Temp VariableHow to SWAP Two Numbers in Java Without Temp variable or Without Third variable
    December 8, 2019
  • How to Swap Two Numbers in Java with Temp VariableHow to SWAP Two Numbers in Java using Temp Variable
    December 1, 2019
  • How to Read Properties file in JavaHow to Read Data From Properties File in Java
    November 27, 2019
  • Compare two arrays in java with out inbuilt functionsHow to Compare Two Arrays in Java without built-in functions
    November 16, 2019
© Selenium Webdriver Appium Complete Tutorial 2023