PHP code example of facebook / webdriver

1. Go to this page and download the library: Download facebook/webdriver library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

facebook / webdriver example snippets


// This would be the url of the host running the server-standalone.jar
$host = 'http://localhost:4444/wd/hub'; // this is the default url and port where Selenium server starts

$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());

$driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());

$desiredCapabilities = DesiredCapabilities::firefox();
$desiredCapabilities->setCapability('acceptSslCerts', false);
$driver = RemoteWebDriver::create($host, $desiredCapabilities);