Java 类org.openqa.selenium.ie.InternetExplorerOptions 实例源码

项目:givemeadriver    文件:InternetExplorerCapabilitiesConverterTest.java   
@Test
public void settingBrowserSize() {
    // given
    WebDriverProperties properties = new WebDriverProperties();
    properties.setProperty("browserSize", "1690x1000");

    // when
    Capabilities convertedCapabilities = internetExplorerCapabilitiesConverter.convert(properties);

    // then
    // expected safari options
    InternetExplorerOptions expectedInternetExplorerOptions = new InternetExplorerOptions();
    expectedInternetExplorerOptions.setCapability(CAPABILITY_AUTOCLOSE, false);
    expectedInternetExplorerOptions.setCapability(CAPABILITY_BROWSER_SIZE, "1690x1000");

    assertThat(convertedCapabilities.asMap()).isEqualTo(expectedInternetExplorerOptions.asMap());

}
项目:Testy    文件:IExplorerConfigReader.java   
private void setOptions(InternetExplorerOptions options) {
    for (Map.Entry<Object, Object> entry : entrySet()) {
        String key = (String) entry.getKey();
        if (key.startsWith("desired.capabilities.")) {
            String preferenceKey = key.substring(21);
            String value = (String) entry.getValue();

            if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("false")) {
                boolean aBoolean = Boolean.valueOf(value);
                options.setCapability(preferenceKey, aBoolean);
            } else {
                try {
                    int intValue = Integer.parseInt(value);
                    options.setCapability(preferenceKey, intValue);
                } catch (NumberFormatException e) {
                    options.setCapability(preferenceKey, value);
                }
            }
        }
    }
    LOGGER.info("The properties was load with success: {}", toString());
}
项目:givemeadriver    文件:InternetExplorerCapabilitiesConverter.java   
@Override
public Capabilities convert(WebDriverProperties properties) {
    InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions();

    // general options for logging purpose
    internetExplorerOptions.setCapability(CAPABILITY_AUTOCLOSE, properties.isAutoClose());
    addToInternetExplorerOptionsIfNoEmptyValue(internetExplorerOptions, CAPABILITY_DRIVER_VERSION, properties.getDriverVersion());
    addToInternetExplorerOptionsIfNoEmptyValue(internetExplorerOptions, CAPABILITY_BROWSER_SIZE, properties.getBrowserSize());

    return internetExplorerOptions;
}
项目:JDI    文件:SeleniumDriverFactory.java   
public InternetExplorerOptions defaultIEOptions() {
    InternetExplorerOptions cap = new InternetExplorerOptions();
    cap.setCapability(INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    cap.setCapability("ignoreZoomSetting", true);
    //cap.setCapability("requireWindowFocus", true);
    return (InternetExplorerOptions) modifyCapabilities.apply(cap);
}
项目:frameworkium-core    文件:InternetExplorerImpl.java   
@Override
public InternetExplorerOptions getCapabilities() {
    InternetExplorerOptions ieOptions = new InternetExplorerOptions();
    ieOptions.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);
    ieOptions.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, true);
    ieOptions.setCapability("requireWindowFocus", true);
    return ieOptions;
}
项目:minium    文件:WebDriverFactory.java   
@Override
public WebDriver create(WebDriverFactory webDriverFactory, DesiredCapabilities desiredCapabilities) {
    InternetExplorerDriverServiceProperties serviceProperties = webDriverFactory.driverServices == null ? null : webDriverFactory.driverServices.getInternetExplorer();
    DriverService driverService = serviceProperties == null ? null : serviceProperties.getDriverService();
    InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions().merge(desiredCapabilities);
    return driverService == null ? new InternetExplorerDriver(internetExplorerOptions) : new RemoteWebDriver(driverService.getUrl(), internetExplorerOptions);
}
项目:Testy    文件:IExplorerConfigReader.java   
/***
 * If you're using Selenium Grid, make sure the selenium server is in the same folder with the IEDriverServer
 * or include the path to the ChromeDriver in command line when registering the node:
 * -Dwebdriver.chrome.driver=%{path to chrome driver}
 * @return Internet Explorer capabilities
 */
private InternetExplorerOptions getOptions() {
    InternetExplorerOptions options = new InternetExplorerOptions();
    setOptions(options);
    String driverPath = getProperty("browser.driver.path");
    if (!"".equals(driverPath)) {
        System.setProperty("webdriver.ie.driver", driverPath);
    }
    return options;
}
项目:Testy    文件:IExplorerConfigReader.java   
@Override
public WebDriver createDriver(URL remoteUrl) throws IOException {
    InternetExplorerOptions capabilities = getOptions();
    if (isRemoteDriver()) {
        RemoteWebDriver driver = new RemoteWebDriver(remoteUrl, capabilities);
        driver.setFileDetector(new LocalFileDetector());
        return driver;
    } else {
        return new InternetExplorerDriver(capabilities);
    }
}
项目:givemeadriver    文件:InternetExplorerCapabilitiesConverter.java   
private void addToInternetExplorerOptionsIfNoEmptyValue(InternetExplorerOptions internetExplorerOptions, String key, String value) {
    if (isNotEmpty(value)) {
        internetExplorerOptions.setCapability(key, value);
    }
}
项目:givemeadriver    文件:InternetExplorerDriverFactory.java   
@Override
public WebDriver createDriver(Capabilities capabilities) {
    String driverVersion = (String) capabilities.getCapability(CAPABILITY_DRIVER_VERSION);
    InternetExplorerDriverManager.getInstance().version(driverVersion).setup();
    return new InternetExplorerDriver((InternetExplorerOptions) capabilities);
}
项目:frameworkium-core    文件:InternetExplorerImpl.java   
@Override
public WebDriver getWebDriver(Capabilities capabilities) {
    return new InternetExplorerDriver(new InternetExplorerOptions(capabilities));
}