Example usage for org.openqa.selenium.remote CapabilityType ACCEPT_INSECURE_CERTS

List of usage examples for org.openqa.selenium.remote CapabilityType ACCEPT_INSECURE_CERTS

Introduction

In this page you can find the example usage for org.openqa.selenium.remote CapabilityType ACCEPT_INSECURE_CERTS.

Prototype

String ACCEPT_INSECURE_CERTS

To view the source code for org.openqa.selenium.remote CapabilityType ACCEPT_INSECURE_CERTS.

Click Source Link

Usage

From source file:ca.nrc.cadc.web.selenium.AbstractWebApplicationIntegrationTest.java

License:Open Source License

/**
 * Override to set up your specific external resource.
 *///from   w w  w  .ja  v a 2  s  .  c  o  m
@BeforeClass
public static void setUp() {
    try {
        final String seleniumURL = seleniumServerURL
                + (seleniumServerURL.contains(SELENIUM_SERVER_URL_ENDPOINT) ? ""
                        : SELENIUM_SERVER_URL_ENDPOINT);
        System.out.println("Connecting to " + seleniumURL);

        final String browserDriverName = System.getProperty("driver");
        driverCapabilities = CAPABILITIES_LOOKUP.get(browserDriverName.toLowerCase());
        driverCapabilities.setCapability(CapabilityType.HAS_NATIVE_EVENTS, true);
        driverCapabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, true);
        driverCapabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
        driverCapabilities.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
        driverCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

        driver = new RemoteWebDriver(new URL(seleniumURL), driverCapabilities);

        username = System.getProperty("user.name");
        password = System.getProperty("user.password");
        webURL = System.getProperty("web.app.url");
    } catch (MalformedURLException e) {
        System.err.println("Can't create URL.");
        e.printStackTrace(System.err);
        throw new RuntimeException(e);
    }

    driver.manage().window().maximize();

    final WebDriver.Timeouts timeouts = driver.manage().timeouts();

    // Safari does not support setTimeout.
    if (!driverCapabilities.getBrowserName().contains("afari")) {
        // Set the timeout to four minutes.
        timeouts.pageLoadTimeout(TIMEOUT_IN_MILLISECONDS, TimeUnit.MILLISECONDS);
    }

    timeouts.setScriptTimeout(TIMEOUT_IN_MILLISECONDS, TimeUnit.MILLISECONDS);
}

From source file:org.keycloak.testsuite.drone.KeycloakWebDriverConfigurator.java

License:Apache License

private void acceptAllSSLCerts(WebDriverConfiguration webDriverCfg, DesiredCapabilities capabilitiesToAdd) {
    if (webDriverCfg.getBrowser().equals("internetexplorer")) {
        return; // IE not supported
    }/*from  w w w.ja v  a  2  s  .co  m*/
    capabilitiesToAdd.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    capabilitiesToAdd.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
}