Package org.openqa.selenium.chrome

Examples of org.openqa.selenium.chrome.ChromeDriverService


    }

    @Test
    public void shouldQuitWebDriverAndStopServiceWhenQuitBrowserIsInvoked() throws Exception {
        ChromeDriver mockChromeDriver = mock(ChromeDriver.class);
        ChromeDriverService mockService = mock(ChromeDriverService.class);
        when(mockService.isRunning()).thenReturn(true);
        config.getServices().put(config.currentThreadName(), mockService);

        config.quitBrowser(mockChromeDriver);

        verify(mockChromeDriver).quit();
View Full Code Here


    }

    @Test
    public void shouldNotStopServiceIfNotRunningWhenQuitBrowserIsInvoked() throws Exception {
        ChromeDriver mockChromeDriver = mock(ChromeDriver.class);
        ChromeDriverService mockService = mock(ChromeDriverService.class);
        when(mockService.isRunning()).thenReturn(false);
        config.getServices().put(config.currentThreadName(), mockService);

        config.quitBrowser(mockChromeDriver);

        verify(mockChromeDriver).quit();
View Full Code Here

    }

    @Test
    public void shouldBeAbleToCallQuitBrowserMultipleTimes() throws Exception {
        ChromeDriver mockChromeDriver = mock(ChromeDriver.class);
        ChromeDriverService mockService = mock(ChromeDriverService.class);
        when(mockService.isRunning()).thenReturn(true);
        config.getServices().put(config.currentThreadName(), mockService);

        config.quitBrowser(mockChromeDriver);
        config.quitBrowser(mockChromeDriver);
View Full Code Here

            String executable = PathUtils.normalize(driverOptions.get(CHROMEDRIVER));
            if (!new File(executable).canExecute())
                throw new IllegalArgumentException("Missing ChromeDriver: " + executable);
            System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, executable);
        }
        ChromeDriverService service = CustomChromeDriverService.createService(driverOptions.getEnvVars());
        ChromeOptions options = new ChromeOptions();
        if (driverOptions.has(PROXY))
            options.addArguments("--proxy-server=http://" + driverOptions.get(PROXY));
        if (driverOptions.has(CLI_ARGS))
            options.addArguments(driverOptions.getCliArgs());
View Full Code Here

      System.out.println("Using Chrome");

      // Use technique here:
      // http://code.google.com/p/selenium/wiki/ChromeDriver
      ChromeDriverService service = startChromeDriverService();
      driver = new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome());

      System.out.println(driver.toString());
      selenium = new WebDriverBackedSelenium(driver, Config.inst().TEAMMATES_URL);

      /*
 
View Full Code Here

      System.exit(1);
    }

    try
    {
      ChromeDriverService chromeDriverService = new ChromeDriverService.Builder()
          .usingDriverExecutable(new File(System.getProperty(CHROME)))
          .usingAnyFreePort().build();
      return chromeDriverService;
    }
    catch (Throwable t)
View Full Code Here

public class ChromeBrowser {
  private static Log log = LogFactory.getLog(ChromeBrowser.class);
  public static WebDriver getDriver() {
    try {
      File file = new File(Config.chrome_webdriver_location);
      ChromeDriverService service = new ChromeDriverService.Builder()
          .usingChromeDriverExecutable(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

      System.out.println("Using Chrome");

      // Use technique here:
      // http://code.google.com/p/selenium/wiki/ChromeDriver
      ChromeDriverService service = startChromeDriverService();
      setDriver(new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome()));

      System.out.println(getDriver().toString());
      selenium = new WebDriverBackedSelenium(getDriver(), Config.inst().TEAMMATES_URL);

      /*
 
View Full Code Here

public class ChromeBrowser implements BrowserFactory {
  private static Log log = LogFactory.getLog(ChromeBrowser.class);
  public WebDriver getDriver() {
    try {
      File file = new File(Config.chrome_webdriver_location);
      ChromeDriverService service = new ChromeDriverService.Builder()
          .usingChromeDriverExecutable(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

TOP

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

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.