Package org.openqa.selenium.chrome

Examples of org.openqa.selenium.chrome.ChromeDriver


      if (startMaximized) {
        // Due do bug in ChromeDriver we need this workaround
        // http://stackoverflow.com/questions/3189430/how-do-i-maximize-the-browser-window-using-webdriver-selenium-2
        options.addArguments("chrome.switches", "--start-maximized");
      }
      return new ChromeDriver(options);
    } else if (ie()) {
      DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
      ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
      return maximize(new InternetExplorerDriver(ieCapabilities));
    } else if (htmlUnit()) {
View Full Code Here


    Runtime.getRuntime().addShutdownHook(new WebdriversFinalCleanupThread(currentThread()));
    return webDriver;
  }

  protected WebDriver createChromeDriver() {
    return new ChromeDriver();
  }
View Full Code Here

    if (startMaximized) {
      // Due do bug in ChromeDriver we need this workaround
      // http://stackoverflow.com/questions/3189430/how-do-i-maximize-the-browser-window-using-webdriver-selenium-2
      options.addArguments("chrome.switches", "--start-maximized");
    }
    return new ChromeDriver(options);
  }
View Full Code Here

      if (startMaximized) {
        // Due do bug in ChromeDriver we need this workaround
        // http://stackoverflow.com/questions/3189430/how-do-i-maximize-the-browser-window-using-webdriver-selenium-2
        options.addArguments("chrome.switches", "--start-maximized");
      }
      return new ChromeDriver(options);
    } else if (ie()) {
      DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
      ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
      return maximize(new InternetExplorerDriver(ieCapabilities));
    } else if (htmlUnit()) {
View Full Code Here

      if (startMaximized) {
        // Due do bug in ChromeDriver we need this workaround
        // http://stackoverflow.com/questions/3189430/how-do-i-maximize-the-browser-window-using-webdriver-selenium-2
        options.addArguments("chrome.switches", "--start-maximized");
      }
      return new ChromeDriver(options);
    } else if (ie()) {
      DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
      ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
      return maximize(new InternetExplorerDriver(ieCapabilities));
    } else if (htmlUnit()) {
View Full Code Here

                configuration.getFilterAttributeNames(), configuration
                        .getCrawlSpecificationReader().getWaitAfterEvent(), configuration
                        .getCrawlSpecificationReader().getWaitAfterReloadUrl());

      case chrome:
        return WebDriverBackedEmbeddedBrowser.withDriver(new ChromeDriver(),
                configuration.getFilterAttributeNames(), configuration
                        .getCrawlSpecificationReader().getWaitAfterEvent(), configuration
                        .getCrawlSpecificationReader().getWaitAfterReloadUrl());

      case remote:
View Full Code Here

  public static class ChromeDriverHandler extends DriverHandler {
    @Override
    protected WebDriver createWebDriver() {
      System.setProperty("webdriver.chrome.driver", DriverRule.getChromeDriverExePath().toAbsolutePath().toString());
      return new ChromeDriver();
    }
View Full Code Here

        if (capabilities != null) {
            capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
            ChromeOptions options = new ChromeOptions();
            options.addArguments("--test-type");
            capabilities.setCapability(ChromeOptions.CAPABILITY,options);
            return new ChromeDriver(capabilities);
        } else return new ChromeDriver();

    }
View Full Code Here

            crawlWaitEvent, crawlWaitReload);
  }

  private EmbeddedBrowser newChromeBrowser(ImmutableSortedSet<String> filterAttributes,
          long crawlWaitReload, long crawlWaitEvent) {
    ChromeDriver driverChrome;
    if (configuration.getProxyConfiguration() != null
            && configuration.getProxyConfiguration().getType() != ProxyType.NOTHING) {
      ChromeOptions optionsChrome = new ChromeOptions();
      String lang = configuration.getBrowserConfig().getLangOrNull();
      if (!Strings.isNullOrEmpty(lang)) {
        optionsChrome.setExperimentalOptions("intl.accept_languages", lang);
      }
      optionsChrome.addArguments("--proxy-server=http://"
              + configuration.getProxyConfiguration().getHostname() + ":"
              + configuration.getProxyConfiguration().getPort());
      driverChrome = new ChromeDriver(optionsChrome);
    } else {
      driverChrome = new ChromeDriver();
    }

    return WebDriverBackedEmbeddedBrowser.withDriver(driverChrome, filterAttributes,
            crawlWaitEvent, crawlWaitReload);
  }
View Full Code Here

            HtmlUnitDriver d = new HtmlUnitDriver();
            d.getWebClient().getOptions().setJavaScriptEnabled(true);
            d.getWebClient().getOptions().setCssEnabled(false);
            driver = d;
        } else if (browser.equals("chrome")) {
            driver = new ChromeDriver();
        } else if (browser.equals("firefox")) {
            driver = new FirefoxDriver();
        } else {
            throw new RuntimeException("Unsupported browser " + browser);
        }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.chrome.ChromeDriver

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.