setCapability()
setCapability()
method configures the WebDriver instance with the capabilities through an instance of DesiredCapabilities() as follows:
public function testShouldProvideAccessToCapabilitiesUsingSettersAndGetters()
{
$capabilities = new DesiredCapabilities();
// generic capability setter
$capabilities->setCapability('custom', 1337);
// specific setters
$capabilities->setBrowserName(WebDriverBrowserType::CHROME);
$capabilities->setPlatform(WebDriverPlatform::LINUX);
$capabilities->setVersion(333);
$this->assertSame(1337, $capabilities->getCapability('custom'));
$this->assertSame(WebDriverBrowserType::CHROME, $capabilities->getBrowserName());
$this->assertSame(WebDriverPlatform::LINUX, $capabilities->getPlatform());
$this->assertSame(333, $capabilities->getVersion());
}
--no-sandbox
-no-sandbox
argument can be added through instance of ChromeOptions()
and further can be added to the instance of DesiredCapabilities() as follows:
$options = new ChromeOptions();
$options->addArguments(array('--no-sandbox'));
$capabilities = DesiredCapabilities::chrome();
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
enablePassThrough
enablePassThrough
mode was introduced for the first time in Selenium Client v3.5.0 . enablePassThrough allowed a connection from your test's RemoteWebDriver, through the Grid Hub, to a Grid Node, and down to a DriverService and then to the browser to use the same WebDriver protocol (the Json Wire Protocol or the W3C one) end to end without translation.
enablePassThrough mode could have been disabled by starting the standalone server or Grid node with the argument -enablePassThrough false
With the release and availability of Selenium Client v3.9.0 all HTTP communication was switched to OkHttp. Though you can still change the version back to the Apache HttpClient by setting the webdriver.http.factory
system property to apache
.
Simultanously support for the passthrough mode for the server was dropped.
Here you can find a detailed discussion on enablePassThrough not available for selenium server 3.9.1