Last active
June 21, 2019 08:10
-
-
Save sahajamit/b285046029338e34c94c1d03e761c718 to your computer and use it in GitHub Desktop.
chrome-dev-tools-01.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChromeOptions options = new ChromeOptions(); | |
options.setExperimentalOption("useAutomationExtension", false); | |
options.addArguments(Arrays.asList("--start-maximized")); | |
options.setBinary("<chromebinary path>"); | |
DesiredCapabilities crcapabilities = DesiredCapabilities.chrome(); | |
crcapabilities.setCapability(ChromeOptions.CAPABILITY, options); | |
crcapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); | |
System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, System.getProperty("user.dir") + "/target/chromedriver.log"); | |
System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, System.getProperty("user.dir") + "/driver/chromedriver.exe"); | |
ChromeDriverService service = new ChromeDriverService.Builder() | |
.usingAnyFreePort() | |
.withVerbose(true) | |
.build(); | |
service.start(); | |
driver = new RemoteWebDriver(service.getUrl(),crcapabilities); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment