Once start the test run, remote web-driver has initialized for the given capabilities:
Below is the selenium node log:[Here I am setting some chrome options]
19:16:08.245 INFO - Creating a new session for Capabilities [{browserName=chrome, takesScreenshot=true, chromeOptions={mobileEmulation={deviceMetrics={pixelRatio=2, width=768, height=1024}, userAgent=Mozilla/5.0 (iPad; CPU OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4}, args=[--ignore-certificate-errors, --disable-bundled-ppapi-flash, --disable-extensions, --disable-web-security, --always-authorize-plugins, --allow-running-insecure-content, --test-type, --enable-npapi], extensions=[]}, version=,platform=ANY}]
Depends on my requirement I can able to set chrome options in the remote webdriver capabilities. but couldn't get those values.
I need to get deviceMetrics
and userAgent
values from the desired capabilities?
I tried with::
String chromeoptions= ((RemoteWebDriver) driver).getCapabilities().getCapability(ChromeOptions.CAPABILITY);
Getting null
value in the chromeoptions.