Selenium and chrome options in php

Below example shows how to launch the chrome browser with various options (arguments) in Selenium in PHP.
class LaunchChrome extends PHPUnit_Framework_TestCase {

protected $driver;

public function setUp()
$options = new ChromeOptions();

// Use different chrome binary

//Setting Arguments for the chrome browser

//Add extensions for chrome browser
//give path to .crx extension file’,

$caps = DesiredCapabilities::chrome();
$caps->setCapability(ChromeOptions::CAPABILITY, $options);
$this->driver = RemoteWebDriver::create(‘https://localhost:4444/wd/hub’, $caps);

public function testChromeOptions()
// checking that page title contains word ‘Tutorial’
$this->assertContains(‘Tutorial’, $this->driver->getTitle());

public function tearDown()
//Quit the driver

Web development and Automation testing

solutions delivered!!