Search in sources :

Example 81 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project ddd-cqrs-sample by BottegaIT.

the class BrowserAgentDriverProvider method createChromeDriver.

@Override
protected ChromeDriver createChromeDriver() {
    DesiredCapabilities capabilities = DesiredCapabilities.chrome();
    String chromeBinary = System.getProperty("chrome.binary");
    if (StringUtils.isNotBlank(chromeBinary)) {
        capabilities.setCapability("chrome.binary", chromeBinary);
    }
    return new ChromeDriver(capabilities);
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) ChromeDriver(org.openqa.selenium.chrome.ChromeDriver)

Example 82 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project ddd-cqrs-sample by BottegaIT.

the class BrowserAgentDriverProvider method createInternetExplorerDriver.

@Override
protected InternetExplorerDriver createInternetExplorerDriver() {
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    return new InternetExplorerDriver(capabilities);
}
Also used : InternetExplorerDriver(org.openqa.selenium.ie.InternetExplorerDriver) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities)

Example 83 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project wechat by dllwh.

the class SeleniumHandler method getIEDriver.

/**
 * @方法描述: 获取IE驱动
 * @return
 */
private WebDriver getIEDriver() {
    String path = genPath + props.getProperty("ieDriver");
    System.getProperties().setProperty("webdriver.ie.driver", path);
    DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
    ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    InternetExplorerDriver driver = new InternetExplorerDriver(ieCapabilities);
    return driver;
}
Also used : InternetExplorerDriver(org.openqa.selenium.ie.InternetExplorerDriver) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities)

Example 84 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project muikku by otavanopisto.

the class AbstractUITest method createPhantomJsDriver.

protected WebDriver createPhantomJsDriver() {
    DesiredCapabilities desiredCapabilities = DesiredCapabilities.phantomjs();
    desiredCapabilities.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, ".phantomjs/bin/phantomjs");
    desiredCapabilities.setCapability(PhantomJSDriverService.PHANTOMJS_PAGE_CUSTOMHEADERS_PREFIX + "Accept-Language", "fi_FI");
    desiredCapabilities.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[] { "--ignore-ssl-errors=true", "--webdriver-loglevel=NONE", "--load-images=false" });
    PhantomJSDriver driver = new PhantomJSDriver(desiredCapabilities);
    driver.manage().window().setSize(new Dimension(1280, 1024));
    return driver;
}
Also used : PhantomJSDriver(org.openqa.selenium.phantomjs.PhantomJSDriver) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Dimension(org.openqa.selenium.Dimension)

Example 85 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project selenium-tests by Wikia.

the class AndroidBrowser method setOptions.

@Override
public void setOptions() {
    DesiredCapabilities destCaps = new DesiredCapabilities();
    destCaps.setCapability("deviceName", Configuration.getDeviceName());
    URL url = null;
    try {
        url = new URL("http://" + Configuration.getAppiumIp() + "/wd/hub");
    } catch (MalformedURLException e) {
        Log.log("getAndroindInstance", e, false);
    }
    mobileDriver = new AndroidDriver(url, destCaps);
}
Also used : MalformedURLException(java.net.MalformedURLException) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) AndroidDriver(io.appium.java_client.android.AndroidDriver) URL(java.net.URL)

Aggregations

DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)173 File (java.io.File)55 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)40 HashMap (java.util.HashMap)33 URL (java.net.URL)32 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)29 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)28 Test (org.testng.annotations.Test)22 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)20 BeforeClass (org.junit.BeforeClass)19 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)18 TestSetup (com.coveros.selenified.utilities.TestSetup)17 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)15 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)14 Before (org.junit.Before)13 Test (org.junit.Test)13 MalformedURLException (java.net.MalformedURLException)12 WebDriver (org.openqa.selenium.WebDriver)12 Actions (org.openqa.selenium.interactions.Actions)12 Dimension (org.openqa.selenium.Dimension)11