33# Maven | WebDriverManager | How to run tests in any Browser without Downloading driver exe files

Published: 23 March 2021
on channel: Knowledge Share
1,071
16

In this session you will learn on below topics

1. Adding dependencies to pom.xml files
2. What is WebDriverManager
3. How to run your tests in different browsers with out downloading driver.exe files

Please join below Facebook Group for collaboration
  / 4754296501308288  

Please Subscribe to Knowledge Share Channel where you can learn Automation Testing
   / @knowledgeshare1311  


WebDriverManager is a library which allows to automate the management of the drivers 

Chrome

WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com");
driver.close();

Firefox

WebDriverManager.firefoxdriver().setup();
WebDriver driver = new FirefoxDriver();
driver.get("https://www.google.com");
driver.close();

Edge

WebDriverManager.edgedriver().setup();
WebDriver driver = new EdgeDriver();
driver.get("https://www.google.com");
driver.close();

Internet Explorer

WebDriverManager.iedriver().setup();
WebDriver driver = new InternetExplorerDriver();
driver.get("https://www.google.com");
driver.close();

***********************************
Example Programs
***********************************

package com.Sample;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import io.github.bonigarcia.wdm.WebDriverManager;

public class WebDriverManager_Example_Firefox {

public static void main(String[] args) {

WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
driver.get("http://www.google.com");
driver.manage().window().maximize();
}

}


=============================
Firefox example program
=============================
package com.Sample;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import io.github.bonigarcia.wdm.WebDriverManager;

public class WebDriverManager_Example_Chrome {

public static void main(String[] args) {

WebDriverManager.firefoxdriver().setup();
WebDriver driver=new FirefoxDriver();
driver.get("http://www.google.com");
driver.manage().window().maximize();
}

}
================================
Edge Example Program
================================
package com.Sample;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;

import io.github.bonigarcia.wdm.WebDriverManager;

public class WebDriverManager_Example_Edge {

public static void main(String[] args) {

WebDriverManager.edgedriver().setup();
WebDriver driver=new EdgeDriver();
driver.get("http://www.google.com");
driver.manage().window().maximize();
}

}


GitHub Repository link for basic Selenium programs for practise
https://github.com/knowledgeshare-tec...

Please join below Facebook Group for collaboration
  / 4754296501308288  

Please Subscribe to Knowledge Share Channel where you can learn Automation Testing
   / @knowledgeshare1311  



Please check below Playlist for your easy Learning

Step-by-Step Selenium Learning Playlist
   • Selenium  

Module-wise Learning Playlist for Selenium

Selenium Module - 1 Playlist
   • Selenium - Module_1  

Selenium Module - 2 Playlist
   • Selenium - Module_2  

Selenium Module - 3 Playlist
   • Selenium - Module_3  

Selenium Module - 4 Playlist
   • Selenium - Module_4  

Selenium Module - 5 Playlist
   • Selenium - Module_5  

Selenium Module - 6 Playlist
   • Selenium - Module_6  

Selenium Module - 7 Playlist
   • Selenium - Module_7  

Core Java Basic Concepts Playlist
   • Core Java  

OOPS Concepts Playlist
   • OOPS Concepts in Java  


Watch video 33# Maven | WebDriverManager | How to run tests in any Browser without Downloading driver exe files online without registration, duration hours minute second in high quality. This video was added by user Knowledge Share 23 March 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,07 once and liked it 1 people.