PHP code example of jumper423 / yii2-php-webdriver

1. Go to this page and download the library: Download jumper423/yii2-php-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/ */

    

jumper423 / yii2-php-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
    

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

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

    $desired_capabilities = DesiredCapabilities::firefox();
    $desired_capabilities->setJavascriptEnabled(false);
    RemoteWebDriver::create($host, $desired_capabilities);