Java Code Examples for io.github.bonigarcia.wdm.WebDriverManager#getInstance()

The following examples show how to use io.github.bonigarcia.wdm.WebDriverManager#getInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ForceDownloadTest.java    From webdrivermanager with Apache License 2.0 5 votes vote down vote up
@Test
public void testLatestChrome() {
    WebDriverManager driverManager = WebDriverManager
            .getInstance(driverClass);
    driverManager.forceDownload().avoidBrowserDetection().timeout(TIMEOUT)
            .operatingSystem(OS).setup();
    assertThat(driverManager.getBinaryPath(), notNullValue());
}
 
Example 2
Source File: IExplorerVersionTest.java    From webdrivermanager with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    os = WIN;
    browserManager = WebDriverManager
            .getInstance(InternetExplorerDriver.class);
    specificVersions = new String[] { "2.39", "2.47" };
}
 
Example 3
Source File: CurrentVersionTest.java    From webdrivermanager with Apache License 2.0 5 votes vote down vote up
@Test
public void testCurrentVersion() throws Exception {
    WebDriverManager browserManager = WebDriverManager
            .getInstance(driverManagerType);

    Method method = WebDriverManager.class
            .getDeclaredMethod("getCurrentVersion", URL.class);
    method.setAccessible(true);

    String currentVersion = (String) method.invoke(browserManager,
            new URL(url));

    assertThat(currentVersion, equalTo(expectedVersion));
}
 
Example 4
Source File: EdgeVersionTest.java    From webdrivermanager with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    browserManager = WebDriverManager.getInstance(EdgeDriver.class);
    os = WIN;
    specificVersions = new String[] { "75.0.139.20", "76.0.183.0",
            "77.0.237.0", "78.0.277.0", "79.0.313.0", "80.0.361.111",
            "81.0.409.0", "82.0.459.1" };
}
 
Example 5
Source File: CacheTest.java    From webdrivermanager with Apache License 2.0 5 votes vote down vote up
@Test
public void testCache() throws Exception {
    WebDriverManager browserManager = WebDriverManager
            .getInstance(driverManagerType);
    browserManager.forceDownload().operatingSystem(os)
            .driverVersion(driverVersion).setup();

    CacheHandler cacheHandler = new CacheHandler(new Config());
    Optional<String> driverFromCache = cacheHandler.getDriverFromCache(
            driverVersion, driverName, driverManagerType, arch, os.name());

    log.debug("Driver from cache: {}", driverFromCache);
    assertThat(driverFromCache.get(), notNullValue());
}