Package org.openqa.selenium.chrome

Examples of org.openqa.selenium.chrome.ChromeOptions


            System.setProperty("webdriver.chrome.driver", chromeDriverPath);

            // Tells chrome not to show warning
            // "You are using an unsupported command-line flag: --ignore-certifcate-errors".
            // #14319
            ChromeOptions options = new ChromeOptions();
            options.addArguments("--test-type ");
            driver = new ChromeDriver(options);
        } else if (BrowserUtil.isSafari(desiredCapabilities)) {
            driver = new SafariDriver();
        } else if (BrowserUtil.isPhantomJS(desiredCapabilities)) {
            driver = new PhantomJSDriver();
View Full Code Here


      driver = new OperaDriver(cap);
    }

    else if (name.equals("chrome")) {
      ChromeDriverService service = ChromeDriverService.createDefaultService();
      ChromeOptions options = new ChromeOptions();
      options.addArguments(
        "--start-maximized",
        "--lang=en",
        "--user-data-dir="
          + System.getProperty("wasavi.tests.chrome.profile_path")
      );
View Full Code Here

    if ("chrome".equals(browserType)) {
      // Chrome driver is odd in that the path to Chrome is specified
      // by a desiredCapability when you start a session. The other
      // browser drivers will read a java system property on start.
      // This applies to both remote Chrome and local Chrome.
      ChromeOptions chromeOpts = new ChromeOptions();
      String chromeBin = TestFlag.CHROME_BINARY.getString(null);
      if (chromeBin != null) {
        chromeOpts.setBinary(chromeBin);
      }
      String chromeArgs = TestFlag.CHROME_ARGS.getString(null);
      if (chromeArgs != null) {
        String[] args = chromeArgs.split(";");
        chromeOpts.addArguments(args);
      }
      dc.setCapability(ChromeOptions.CAPABILITY, chromeOpts);
    }

    String url = TestFlag.WEBDRIVER_URL.getString("");
View Full Code Here

  private static WebDriver createDriver() {
    if (remote != null) {
      return createRemoteDriver(remote, browser);
    } else if (CHROME.equalsIgnoreCase(browser)) {
      ChromeOptions options = new ChromeOptions();
      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);
View Full Code Here

  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();
View Full Code Here

  private static WebDriver createDriver() {
    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);
View Full Code Here

    }

    protected WebDriver createChromeWebDriver() throws Exception {
        File profile = new File(profileDir, "chrome");
        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

  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();
View Full Code Here

      } else if (SystemUtils.IS_OS_WINDOWS) {
        chromedriver = "chromedriver.exe";
      }
      System.setProperty("webdriver.chrome.driver", new File(
          "target/webdriver/" + chromedriver).getAbsolutePath());
      ChromeOptions options = new ChromeOptions();

      // This flag avoids a warning in chrome. See:
      // https://code.google.com/p/chromedriver/issues/detail?id=799
      options.addArguments("--test-type");

      // This flag avoids grant the camera
      options.addArguments("--use-fake-ui-for-media-stream");

      // This flag makes using a synthetic video (green with
      // spinner) in webrtc. Or it is needed to combine with
      // use-file-for-fake-video-capture to use a file faking the
      // cam
      options.addArguments("--use-fake-device-for-media-stream");

      driver = new ChromeDriver(options);
    }
    return driver;
  }
View Full Code Here

      } else if (SystemUtils.IS_OS_WINDOWS) {
        chromedriver = "chromedriver.exe";
      }
      System.setProperty("webdriver.chrome.driver", new File(
          "target/webdriver/" + chromedriver).getAbsolutePath());
      ChromeOptions options = new ChromeOptions();

      // This flag avoids a warning in chrome. See:
      // https://code.google.com/p/chromedriver/issues/detail?id=799
      options.addArguments("--test-type");

      driver = new ChromeDriver(options);
    }
  }
View Full Code Here

TOP

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

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.