PHP code example of fonsecas72 / selenium-handler

1. Go to this page and download the library: Download fonsecas72/selenium-handler 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/ */

    

fonsecas72 / selenium-handler example snippets


$seleniumStarterOptions = new SeleniumStartOptions();
$process = new Process('');
$exeFinder = new ExecutableFinder();
$waiter = new ResponseWaitter(new Client());
$starter = new SeleniumStarter($seleniumStarterOptions, $process, $waiter, $exeFinder);

$starter->start();

// timeout is changed in the "waitter" class:
$starter->getResponseWaitter()->setTimeout($input->getOption('timeout'));
// to set a specific selenium location you do:
$starterOptions = $starter->getStartOptions();
$starterOptions->setSeleniumJarLocation($input->getOption('selenium-location'));
// to enable xvfb:
$starterOptions->enabledXvfb();

$this->handler = new SeleniumHandler($starter, $stopper, $downloader, $logWatcher);

bin/selenium start --follow ERROR &