Hope you wanted to ask for a workaround to avoid obsolescence.
The old simple build method is Capabilities
deprecated. Now, ChromeDriverService
and is required as parameters Capabilities
. So, just build a ChromeDriverService
and pass the same thing along with yours Capabilities
to remove the failure warning.
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeDriverService service = new ChromeDriverService.Builder()
.usingDriverExecutable(new File("/usr/local/chromedriver"))
.usingAnyFreePort()
.build();
ChromeDriver driver = new ChromeDriver(service, capabilities);
EDIT:
ChromeDriver(service, capabilities)
,
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeDriverService service = new ChromeDriverService.Builder()
.usingDriverExecutable(new File("/usr/local/chromedriver"))
.usingAnyFreePort()
.build();
ChromeOptions options = new ChromeOptions();
options.merge(capabilities);
ChromeDriver driver = new ChromeDriver(service, options);
DesiredCapabilities
ChromeOptions
setCapability
, ,
ChromeOptions options = new ChromeOptions();
options.setCapability("capability_name", "capability_value");
driver = new ChromeDriver(options);