本文整理汇总了Java中org.openqa.selenium.ie.InternetExplorerOptions.setCapability方法的典型用法代码示例。如果您正苦于以下问题:Java InternetExplorerOptions.setCapability方法的具体用法?Java InternetExplorerOptions.setCapability怎么用?Java InternetExplorerOptions.setCapability使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openqa.selenium.ie.InternetExplorerOptions
的用法示例。
在下文中一共展示了InternetExplorerOptions.setCapability方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例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());
}
示例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;
}
示例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);
}
示例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;
}
示例6: addToInternetExplorerOptionsIfNoEmptyValue
import org.openqa.selenium.ie.InternetExplorerOptions; //导入方法依赖的package包/类
private void addToInternetExplorerOptionsIfNoEmptyValue(InternetExplorerOptions internetExplorerOptions, String key, String value) {
if (isNotEmpty(value)) {
internetExplorerOptions.setCapability(key, value);
}
}