alexschwarz89/browserstack

There is no license information available for the latest version (0.0.2) of this package.

Client library for Browserstack Screenshot API

0.0.2 2015-01-21 09:31 UTC

This package is not auto-updated.

Last update: 2024-03-16 13:53:25 UTC


README

Latest Stable Version Total Downloads

An easy-to-use PHP library for the Browserstack Screenshots API. Working examples included.

Install

Install via composer:

{
    "require": {
        "alexschwarz89/browserstack": "0.0.2"
    }
}

Run composer install.

Example usage

Get an array of available browsers

use Alexschwarz89\Browserstack\Screenshots\Api;
$api         = new Api('username', 'password');
$browserList = $api->getBrowsers();

Generate a screenshot

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;

Query information about the request

$status = $api->getJobStatus('browserstack_jobid');
if ($status->isFinished()) {
  foreach ($status->finishedScreenshots as $screenshot) {
    print $screenshot->image_url ."\n";
  }
}

Bitdeli Badge