Example usage for org.openqa.selenium.chrome ChromeDriverService CHROME_DRIVER_EXE_PROPERTY

List of usage examples for org.openqa.selenium.chrome ChromeDriverService CHROME_DRIVER_EXE_PROPERTY

Introduction

In this page you can find the example usage for org.openqa.selenium.chrome ChromeDriverService CHROME_DRIVER_EXE_PROPERTY.

Prototype

String CHROME_DRIVER_EXE_PROPERTY

To view the source code for org.openqa.selenium.chrome ChromeDriverService CHROME_DRIVER_EXE_PROPERTY.

Click Source Link

Document

System property that defines the location of the chromedriver executable that will be used by the #createDefaultService() default service .

Usage

From source file:com.mgmtp.jfunk.samples.config.ConfigBrowser.java

License:Apache License

@Subscribe
public void configureBrowser(final BeforeWebDriverCreationEvent event) {

    switch (browser) {
    case "firefox": {
        // configure Firefox
    }//  w ww.  j  a  v a2s .  c  o m
    case "chrome": {
        setPathToDriverIfExistsAndIsExecutable(relativePathToChromeDriver,
                ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY);
        // configure Chrome
        break;
    }
    case "ie": {
        setPathToDriverIfExistsAndIsExecutable(relativePathToIeDriver,
                InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY);
        // configure InternetExplorer
        break;
    }
    default: {
        throw new RuntimeException(String.format("Please configure one of the supported browsers in %s",
                JFunkConstants.SCRIPT_PROPERTIES));
    }
    }
}

From source file:com.partnet.automation.selenium.AbstractConfigurableDriverProvider.java

License:Apache License

protected WebDriver getChromeWebDriver() {
    String pathToDriverBin = getOsSpecificBinaryPathFromProp(CHROME_DRIVER_BIN_PROP, "chromedriver");

    System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, pathToDriverBin);
    DesiredCapabilities capabilities = DesiredCapabilities.chrome();

    return new ChromeDriver(capabilities);
}

From source file:com.seleniumtests.ut.browserfactory.TestChromeCapabilityFactory.java

License:Apache License

@Test(groups = { "ut" })
public void testCreateChromeCapabilitiesStandardDriverPathLocal() {
    try {//  www.ja va  2 s  .c o  m
        Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);

        new ChromeCapabilitiesFactory(config).createCapabilities();

        Assert.assertTrue(System.getProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY)
                .replace(File.separator, "/").contains("/drivers/chromedriver_"));
    } finally {
        System.clearProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY);
    }
}

From source file:com.seleniumtests.ut.browserfactory.TestChromeCapabilityFactory.java

License:Apache License

@Test(groups = { "ut" })
public void testCreateChromeCapabilitiesOverrideDriverPathLocal() {
    try {//from  www  .j  a v a  2s.  c o  m
        Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
        Mockito.when(config.getChromeDriverPath()).thenReturn("/opt/chrome/driver/chromedriver");

        new ChromeCapabilitiesFactory(config).createCapabilities();

        Assert.assertEquals(
                System.getProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY).replace(File.separator, "/"),
                "/opt/chrome/driver/chromedriver");
    } finally {
        System.clearProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY);
    }
}

From source file:com.seleniumtests.ut.browserfactory.TestChromeCapabilityFactory.java

License:Apache License

@Test(groups = { "ut" })
public void testCreateChromeCapabilitiesStandardDriverPathGrid() {
    Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);

    new ChromeCapabilitiesFactory(config).createCapabilities();

    Assert.assertNull(System.getProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY));
}

From source file:io.appium.java_client.pagefactory_tests.DesktopBrowserCompatibilityTest.java

License:Apache License

/**
 * The starting.//from w  w w.  ja  v a 2 s.  c om
 */
public void setUp() {
    if (current.is(Platform.WINDOWS)) {
        System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY,
                "src/test/java/io/appium/java_client/pagefactory_tests/chromedriver.exe");
    } else {
        System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY,
                "src/test/java/io/appium/java_client/pagefactory_tests/chromedriver");
    }
}