Package org.openqa.selenium.chrome

Examples of org.openqa.selenium.chrome.ChromeDriver


          driver = new RemoteWebDriver(new URL("http://"
              + hostAddress + ":" + hubPort + "/wd/hub"),
              capabilities);

        } else {
          driver = new ChromeDriver(options);
        }

      }
      driver.manage().timeouts()
          .setScriptTimeout(timeout, TimeUnit.SECONDS);
View Full Code Here


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

    private static WebDriver buildWebDriver(final Properties testProperties) {
        final String webdriverType = System.getProperty("uitest.webdriver", "firefox");

        WebDriver driver;
        if (webdriverType.equals("chrome")) {
            driver = new ChromeDriver();
        } else if (webdriverType.equals("firefox")) {
            driver = new FirefoxDriver();
        } else {
            driver = new InternetExplorerDriver();
        }
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

            return poll;
        }
        if (webDriverList.size() < capacity) {
            synchronized (webDriverList) {
                if (webDriverList.size() < capacity) {
                    ChromeDriver e = new ChromeDriver();
                    innerQueue.add(e);
                    webDriverList.add(e);
                }
            }
View Full Code Here

        preferences.put("profile.default_content_settings", contentSettings);

        DesiredCapabilities caps = DesiredCapabilities.chrome();
        caps.setCapability("chrome.prefs", preferences);
        caps.setCapability("chrome.switches", Arrays.asList("--user-data-dir=/Users/yihua/temp/chrome"));
        WebDriver webDriver = new ChromeDriver(caps);
        webDriver.get("http://huaban.com/");
        WebElement webElement = webDriver.findElement(By.xpath("/html"));
        System.out.println(webElement.getAttribute("outerHTML"));
        webDriver.close();
    }
View Full Code Here

             */
            public void setLocalDriver() {
                switch (this.desc) {
                    case "firefox"  : this.driver = new FirefoxDriver();break;
                    case "iexplorer": this.driver = new InternetExplorerDriver();break;
                    case "chrome"   : this.driver = new ChromeDriver();break;
                    case "opera"    : this.driver = new OperaDriver();break;
                    case "htmlunit" : this.driver = new HtmlUnitDriver();break;
                }
                setJSDriver();
                this.driver.manage().timeouts().pageLoadTimeout(MAX_WAIT_S, TimeUnit.SECONDS);
View Full Code Here

    private Browser createLocalBrowser() {
        if (FIREFOX.equals(browserType)) {
            return new SeleniumBrowser(new FirefoxDriver());
        }
        else if (CHROME.equals(browserType)) {
            return new SeleniumBrowser(new ChromeDriver());
        }
        else if (IE.equals(browserType)) {
            return new SeleniumBrowser(new InternetExplorerDriver());
        }
        else throw new RuntimeException(String.format("Unknown browser type: \"%s\"", browserType));
View Full Code Here

            options.addArguments("--proxy-server=http://" + driverOptions.get(PROXY));
        if (driverOptions.has(CLI_ARGS))
            options.addArguments(driverOptions.getCliArgs());
        caps.setCapability(ChromeOptions.CAPABILITY, options);
        caps.merge(driverOptions.getCapabilities());
        ChromeDriver driver = new ChromeDriver(service, caps);
        setInitialWindowSize(driver, driverOptions);
        return driver;
    }
View Full Code Here


public class WaitExample {

  public static void main(String[] args) throws InterruptedException {
    WebDriver dr = new ChromeDriver();
   
    File file = new File("src/wait.html");
    String filePath = "file:///" + file.getAbsolutePath();
    System.out.printf("now accesss %s \n", filePath);
   
    dr.get(filePath);
    Thread.sleep(1000);
   
//    �����ť
    dr.findElement(By.id("btn")).click();
   
    (new WebDriverWait(dr, 10)).until(new ExpectedCondition<Boolean>() {
        public Boolean apply(WebDriver d) {
                    return d.findElement(By.className("label")).isDisplayed();
                }
      });
           
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }
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.