Package org.openqa.selenium.chrome

Examples of org.openqa.selenium.chrome.ChromeDriver


            filterAttributes, 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


    if (remote != null) {
      return createRemoteDriver(remote, browser);
    } else if (CHROME.equalsIgnoreCase(browser)) {
      ChromeOptions options = new ChromeOptions();
      options.addArguments("chrome.switches", chromeSwitches);
      return new ChromeDriver(options);
    } else if (ie()) {
      DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
      ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
      return new InternetExplorerDriver(ieCapabilities);
    } else if (htmlUnit()) {
View Full Code Here

        profile.mkdirs();
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--enable-udd-profiles",
                             "--user-data-dir=" + profile,
                             "--allow-file-access-from-files");
        return new ChromeDriver(options);
    }
View Full Code Here

      driverURL = contextClassLoader.getResource("archive/chromedriver.exe");
      if (driverURL == null) {
        throw new NullPointerException("Cannot find chromedriver instance, copy chromedriver.exe from driver to /src/archive/");
      }
      System.setProperty("webdriver.chrome.driver", new File(driverURL.toURI()).getAbsolutePath());
      return new ChromeDriver();
      /*
      try {
        return new RemoteWebDriver(new URL("http://localhost:9515"), DesiredCapabilities.chrome());
      } catch (MalformedURLException e) {
        throw new RuntimeException(e);
View Full Code Here

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

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

    }
    return wrapper;
  }

  protected WebDriver createChromeDriver() {
    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

      File file = new File(Config.chrome_webdriver_location);
      ChromeDriverService service = new ChromeDriverService.Builder()
          .usingDriverExecutable(file)
          .usingAnyFreePort().build();
      service.start();
      WebDriver instance = new ChromeDriver(service, DesiredCapabilities.chrome());
      log.info("Found webdriver instance : " + instance);
      return instance;
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

public class WebdriverJavaJunitTest {
    private static WebDriver driver;

    @BeforeClass
    public static void before() {
        driver = new ChromeDriver();
    }
View Full Code Here

public class WebdriverJavaJunitTest {
    private static WebDriver driver;

    @BeforeClass
    public static void before() {
        driver = new ChromeDriver();
    }
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.