PHP code example of linchpinagency / browserstack

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

    

linchpinagency / browserstack example snippets


use Linchpin\Browserstack\Screenshots\ScreenshotsAPI;
$screenshots_api = new ScreenshotsAPI( 'username', 'password' );
$browser_list    = $api->get_browsers();

use Linchpin\Browserstack\Screenshots\ScreenshotsAPI;
use Linchpin\Browserstack\Screenshots\Request;
$screenshots_api = new ScreenshotsAPI( 'account', 'password' );
$request         = Request::build_request( 'http://www.example.org', 'Windows', '8.1', 'ie', '11.0' );
$response        = $screenshots_api->send_request( $request );
$job_ID          = $response->job_ID;

$status = $api->get_job_status( 'browserstack_jobID' );
if ( $status->is_finished() ) {
  foreach ( $status->finished_screenshots as $screenshot ) {
    print $screenshot->image_url ."\n";
  }
}