use of org.openqa.selenium.remote.DesiredCapabilities in project android by owncloud.
the class Common method setUpCommonDriver.
protected AndroidDriver setUpCommonDriver() throws Exception {
File rootPath = new File(System.getProperty("user.dir"));
File appDir = new File(rootPath, "src/test/resources");
File app = new File(appDir, "ownCloud.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "test");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.owncloud.android");
capabilities.setCapability("appActivity", ".ui.activity.FileDisplayActivity");
capabilities.setCapability("appWaitActivity", ".authentication.AuthenticatorActivity");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(waitingTime, TimeUnit.SECONDS);
wait = new WebDriverWait(driver, waitingTime, 50);
return driver;
}
use of org.openqa.selenium.remote.DesiredCapabilities in project Asqatasun by Asqatasun.
the class PhantomJsFactory method make.
/**
*
* @param config
* @return A FirefoxDriver.
*/
@Override
public RemoteWebDriver make(HashMap<String, String> config) {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setJavascriptEnabled(true);
if (System.getProperty(PHANTOMJS_PATH_PROPERTY) != null) {
path = System.getProperty(PHANTOMJS_PATH_PROPERTY);
}
caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, path);
return new PhantomJSDriver(caps);
}
use of org.openqa.selenium.remote.DesiredCapabilities in project geode by apache.
the class WebDriverRule method setUpWebDriver.
private void setUpWebDriver() {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setJavascriptEnabled(true);
capabilities.setCapability("takesScreenshot", true);
capabilities.setCapability("phantomjs.page.settings.userAgent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:16.0) Gecko/20121026 Firefox/16.0");
driver = new PhantomJSDriver(capabilities);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(300, TimeUnit.SECONDS);
}
use of org.openqa.selenium.remote.DesiredCapabilities 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.");
}
}
}
use of org.openqa.selenium.remote.DesiredCapabilities in project charts by vaadin.
the class ChartsBrowserFactory method createIE.
private DesiredCapabilities createIE(Browser browser, String version) {
DesiredCapabilities capabilities = create(browser, version, Platform.WINDOWS);
capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
return capabilities;
}
Aggregations