Package org.openqa.selenium.remote

Examples of org.openqa.selenium.remote.DesiredCapabilities


        Validate.isValidUrl(remoteAddress, "Remote address must be a valid url, " + remoteAddress);

        return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { URL.class,
                DesiredCapabilities.class },
                new Object[] { remoteAddress, new DesiredCapabilities(configuration.getCapabilities()) }, AndroidDriver.class);

    }
View Full Code Here


     */
    @Override
    public ChromeDriver createInstance(TypedWebDriverConfiguration<ChromeDriverConfiguration> configuration) {

        // set capabilities
        DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities());

        String driverBinary = configuration.getChromeDriverBinary();
        String binary = (String) capabilities.getCapability("chrome.binary");
        String chromeSwitches = (String) capabilities.getCapability("chrome.switches");

        if (Validate.empty(driverBinary)) {
            driverBinary = SecurityActions.getProperty(CHROME_DRIVER_BINARY_KEY);
        }

        // driver binary configuration
        // this is setting system property
        if (Validate.nonEmpty(driverBinary)) {
            Validate.isExecutable(driverBinary, "Chrome driver binary must point to an executable file, " + driverBinary);
            SecurityActions.setProperty(CHROME_DRIVER_BINARY_KEY, driverBinary);
        }

        // verify binary capabilities
        if (Validate.nonEmpty(binary)) {
            Validate.isExecutable(binary, "Chrome binary must point to an executable file, " + binary);
        }

        // convert chrome switches to an array of strings
        if (Validate.nonEmpty(chromeSwitches)) {
            capabilities.setCapability("chrome.switches", getChromeSwitches(chromeSwitches));
        }

        // FIXME this call will not be supported for a long time
        // Chrome will be using ChromeOptions object
        return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { Capabilities.class },
View Full Code Here

   * @param hubUrl
   *            the url of the hub to use.
   * @return the RemoteWebDriver instance.
   */
  private static RemoteWebDriver buildRemoteWebDriver(String hubUrl) {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setPlatform(Platform.ANY);
    URL url;
    try {
      url = new URL(hubUrl);
    } catch (MalformedURLException e) {
      LOGGER.error("The given hub url of the remote server is malformed can not continue!",
View Full Code Here

  }

  private EmbeddedBrowser newPhantomJSDriver(ImmutableSortedSet<String> filterAttributes,
          long crawlWaitReload, long crawlWaitEvent) {

    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("takesScreenshot", true);
   
    final ProxyConfiguration proxyConf = configuration
        .getProxyConfiguration();
    if (proxyConf != null && proxyConf.getType() != ProxyType.NOTHING) {
      final String proxyAddrCap = "--proxy=" + proxyConf.getHostname()
          + ":" + proxyConf.getPort();
      final String proxyTypeCap = "--proxy-type=http";
      final String[] args = new String[] { proxyAddrCap, proxyTypeCap };
      caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, args);
    }
   
    PhantomJSDriver phantomJsDriver = new PhantomJSDriver(caps);

    return WebDriverBackedEmbeddedBrowser.withDriver(phantomJsDriver, filterAttributes,
View Full Code Here

  private static Log log = LogFactory.getLog(FireFoxBrowser.class);
 
  public WebDriver getDriver() {
    try {
      Report.action("Opening Firefox");
      DesiredCapabilities capabilities = DesiredCapabilities.firefox();
      if(StringUtils.isNotEmpty(Config.proxy_url)) {
        Proxy proxy = new Proxy();
        proxy.setProxyAutoconfigUrl("http://youdomain/config");
        capabilities.setCapability(CapabilityType.PROXY, proxy);
        Report.action("With proxy '" + Config.proxy_url + "'");
      }
      WebDriver driver = new FirefoxDriver(capabilities);
      return driver;
    } catch (Throwable th) {
View Full Code Here

            return PhantomJSDriverService.createDefaultService(capabilities);
        }

        PhantomJSBinary binary = resolveBinary(configuration);

        DesiredCapabilities newCapabilities = new DesiredCapabilities(capabilities);
        newCapabilities.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, binary.getLocation()
                .getAbsolutePath());
        return PhantomJSDriverService.createDefaultService(newCapabilities);
    }
View Full Code Here

        // start the proxy
        ProxyServer proxy = new ProxyServer(4444);
        proxy.start();

        // configure it as a desired capability
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, proxy.seleniumProxy());

        FirefoxDriver driver = new FirefoxDriver(capabilities);
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // start capture
View Full Code Here

import java.util.concurrent.TimeUnit;

public class ErrorTest {
    public static void main(String[] args) throws Exception {
        // **************************************
        DesiredCapabilities capabilities = new DesiredCapabilities();
        Firebug.configure(new File("."), capabilities);
        // **************************************

        FirefoxDriver driver = new FirefoxDriver(capabilities);
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
View Full Code Here

import java.util.concurrent.TimeUnit;

public class FirebugTest {
    public static void main(String[] args) throws IOException, InterruptedException {
        // **************************************
        DesiredCapabilities capabilities = new DesiredCapabilities();
        Firebug.configure(new File("."), capabilities);
        // **************************************

        WebDriver driver = new FirefoxDriver(capabilities);

View Full Code Here

        // start the proxy
        ProxyServer proxy = new ProxyServer(4444);
        proxy.start();

        // configure it as a desired capability
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, proxy.seleniumProxy());

        WebDriver driver = new FirefoxDriver(capabilities);
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // start capture
View Full Code Here

TOP

Related Classes of org.openqa.selenium.remote.DesiredCapabilities

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.