PHP code example of ikr / php-webdriver-journal

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

    

ikr / php-webdriver-journal example snippets


$driver = \RemoteWebDriver::create(
    $seleniumHubUrl,
    \DesiredCapabilities::phantomjs()
);

$wrappedDriver = new \WebDriverJournal\WebDriverProxy(
    $driver,

    new \WebDriverJournal\Probe(
        $driver,

        new \WebDriverJournal\Journal(
            new \WebDriverJournal\DirectoryFilesWriter(
                '/tmp/web-driver-journals',
                $browserSessionIdOfYourChoice
            )
        )
    )
);

$wrappedDriver->manage()->window()->setSize(new \WebDriverDimension(1024, 1024));
$wrappedDriver->manage()->timeouts()->implicitlyWait(8);

$wrappedDriver->get('https://ikr.su/');
$wrappedDriver->findElement(\WebDriverBy::id('btn-next'))->click();
// ...
$wrappedDriver->quit();

$ composer