Skip to content
Wai Hon Law edited this page May 21, 2014 · 6 revisions

ChromeOptions is the class managing the chrome capabilities. You can find more details in https://sites.google.com/a/chromium.org/chromedriver/extensions. Here is the guide of using ChromeOptions in facebook/php-webdirver.

Create an instance of ChromeOptions

$options = new ChromeOptions();

Using a different Chrome executable

// Setting the binary is optional. 
$options->setBinary('/home/php-webdirver/chrome/my_chrome_binary');

Launch with Chrome extensions

// Setting extensions is also optional
$options->addExtensions(array(
  '/path/to/chrome/extension1.crx',
  '/path/to/chrome/extension2.crx',
));

Starting Chrome with the above configuration

$caps = DesiredCapabilities::chrome();
$caps->setCapability(ChromeOptions::CAPABILITY, $options);

$driver = RemoteWebDriver::create($url, $caps);

Clone this wiki locally