Example of WebDriverManager API || Launch browser without any driver exe || Alternative of exe files
Автор: Accidental Insight Videos
Загружено: 2020-11-04
Просмотров: 59
Описание:
To use WebDriverManager from tests in a Maven project, you need to add the WebDriverManager dependency in your pom.xml (Java 8 or upper required), typically using the test scope
WebDriverManager resolves the drivers for the browsers Chrome, Firefox, Edge, Opera, PhantomJS, Internet Explorer, and Chromium. For that, it provides several drivers managers for these browsers. These drivers managers can be used as follows:
WebDriverManager.chromedriver().setup();
WebDriverManager.firefoxdriver().setup();
WebDriverManager.edgedriver().setup();
WebDriverManager.operadriver().setup();
WebDriverManager.phantomjs().setup();
WebDriverManager.iedriver().setup();
WebDriverManager.chromiumdriver().setup();
Example:
package com.maven.LearnProject;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.testng.annotations.BeforeMethod;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
public class LauchChrome {
static WebDriver driver;
@Test
public void f() {
System.out.println("chrome launched");
}
@BeforeMethod
public void beforeMethod() {
WebDriverManager.chromedriver().version("85").setup();
driver = new ChromeDriver();
driver.get(" / @accidentalinsightvideos209 ");
}
@AfterMethod
public void afterMethod() {
}
}
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: