Skip to content

Instantly share code, notes, and snippets.

@sahajamit
Last active June 21, 2019 08:10
Show Gist options
  • Save sahajamit/b285046029338e34c94c1d03e761c718 to your computer and use it in GitHub Desktop.
Save sahajamit/b285046029338e34c94c1d03e761c718 to your computer and use it in GitHub Desktop.
chrome-dev-tools-01.java
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