use of org.openqa.selenium.Capabilities in project spring-boot by spring-projects.
the class LocalHostWebConnectionHtmlUnitDriverTests method createWithCapabilitiesWhenEnvironmentIsNullWillThrowException.
@Test
public void createWithCapabilitiesWhenEnvironmentIsNullWillThrowException() throws Exception {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("Environment must not be null");
Capabilities capabilities = mock(Capabilities.class);
given(capabilities.getBrowserName()).willReturn("chrome");
new LocalHostWebConnectionHtmlUnitDriver(null, capabilities);
}
use of org.openqa.selenium.Capabilities in project fess by codelibs.
the class WebDriverGenerator method startWebDriver.
protected void startWebDriver() {
try {
if (webDriver == null) {
if (webDriverCapabilities == null) {
webDriver = new PhantomJSDriver();
} else {
if (webDriverCapabilities instanceof DesiredCapabilities) {
final DesiredCapabilities capabilities = (DesiredCapabilities) webDriverCapabilities;
webDriverCapabilities.asMap().entrySet().stream().filter(e -> e.getValue() instanceof String && filePathMap.containsKey(e.getValue().toString())).forEach(e -> capabilities.setCapability(e.getKey(), filePathMap.get(e.getValue().toString())));
}
webDriver = new PhantomJSDriver(createDriverService(webDriverCapabilities), webDriverCapabilities);
}
}
final FessConfig fessConfig = ComponentUtil.getFessConfig();
webDriver.manage().window().setSize(new Dimension(fessConfig.getThumbnailHtmlPhantomjsWindowWidthAsInteger(), fessConfig.getThumbnailHtmlPhantomjsWindowHeightAsInteger()));
previousCheckTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
} catch (final Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("WebDriver is not available for generating thumbnails.", e);
} else {
logger.info("WebDriver is not available for generating thumbnails.");
}
}
}
Aggregations