1. Go to this page and download the library: Download alexschwarz89/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/ */
alexschwarz89 / browserstack example snippets
use Alexschwarz89\Browserstack\Screenshots\Api;
$api = new Api('username', 'password');
$browserList = $api->getBrowsers();
use Alexschwarz89\Browserstack\Screenshots\Api;
use Alexschwarz89\Browserstack\Screenshots\Request;
$api = new Api('account', 'password');
$request = Request::buildRequest('http://www.example.org', 'Windows', '8.1', 'ie', '11.0');
$response = $api->sendRequest( $request );
$jobId = $response->jobId;
$status = $api->getJobStatus('browserstack_jobid');
if ($status->isFinished()) {
foreach ($status->finishedScreenshots as $screenshot) {
print $screenshot->image_url ."\n";
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.