当前位置: 首页>>代码示例>>Java>>正文


Java InternetExplorerOptions类代码示例

本文整理汇总了Java中org.openqa.selenium.ie.InternetExplorerOptions的典型用法代码示例。如果您正苦于以下问题:Java InternetExplorerOptions类的具体用法?Java InternetExplorerOptions怎么用?Java InternetExplorerOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InternetExplorerOptions类属于org.openqa.selenium.ie包,在下文中一共展示了InternetExplorerOptions类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: settingBrowserSize

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
@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());

}
 
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:19,代码来源:InternetExplorerCapabilitiesConverterTest.java

示例2: setOptions

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
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());
}
 
开发者ID:sdl,项目名称:Testy,代码行数:23,代码来源:IExplorerConfigReader.java

示例3: convert

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
@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;
}
 
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:12,代码来源:InternetExplorerCapabilitiesConverter.java

示例4: defaultIEOptions

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
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);
}
 
开发者ID:epam,项目名称:JDI,代码行数:8,代码来源:SeleniumDriverFactory.java

示例5: getCapabilities

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
@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;
}
 
开发者ID:Frameworkium,项目名称:frameworkium-core,代码行数:9,代码来源:InternetExplorerImpl.java

示例6: create

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
@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);
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:8,代码来源:WebDriverFactory.java

示例7: getOptions

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
/***
 * 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;
}
 
开发者ID:sdl,项目名称:Testy,代码行数:16,代码来源:IExplorerConfigReader.java

示例8: createDriver

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:sdl,项目名称:Testy,代码行数:12,代码来源:IExplorerConfigReader.java

示例9: addToInternetExplorerOptionsIfNoEmptyValue

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
private void addToInternetExplorerOptionsIfNoEmptyValue(InternetExplorerOptions internetExplorerOptions, String key, String value) {
    if (isNotEmpty(value)) {
        internetExplorerOptions.setCapability(key, value);
    }
}
 
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:6,代码来源:InternetExplorerCapabilitiesConverter.java

示例10: createDriver

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
@Override
public WebDriver createDriver(Capabilities capabilities) {
    String driverVersion = (String) capabilities.getCapability(CAPABILITY_DRIVER_VERSION);
    InternetExplorerDriverManager.getInstance().version(driverVersion).setup();
    return new InternetExplorerDriver((InternetExplorerOptions) capabilities);
}
 
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:7,代码来源:InternetExplorerDriverFactory.java

示例11: getWebDriver

import org.openqa.selenium.ie.InternetExplorerOptions; //导入依赖的package包/类
@Override
public WebDriver getWebDriver(Capabilities capabilities) {
    return new InternetExplorerDriver(new InternetExplorerOptions(capabilities));
}
 
开发者ID:Frameworkium,项目名称:frameworkium-core,代码行数:5,代码来源:InternetExplorerImpl.java


注:本文中的org.openqa.selenium.ie.InternetExplorerOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。