API Documentation

Automated Screenshot Methods

Automated Screenshot Tests are initially ran from the user interface in the Test Center. Each time you run automated screenshots from the Test Center, a new "test" is created on our system with the list of browsers you selected, referenced along with the URL requested. This "test" can be repeated multiple times, each time creating a new "version". Each "version" has it's own set of "results", which are the actual images created from the screenshots performed by our servers.

To access the results of any test, you must have the "id" of the test, as well as the "id" of the version. Hence, the API methods below outline the steps for how one retrieves a list of their "tests", then a list of "versions", and finally a list of "results".

When using the API, you can only run new screenshots based on existing tests (at this time). However, you can run a test on a new url, based on an existing test's list of browsers. Also, you can run new versions of existing tests.
Methods:

Show Screenshot Tests 

Returns a list of all screenshot tests ran

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/show
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
page<integer>1falseSpecify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299.
Examples:
return data as XML using CURL:   curl --user username:password http://crossbrowsertesting.com/api/screenshots/show
return data as JSON using CURL:   curl -d format=json --user username:password http://crossbrowsertesting.com/api/screenshots/show
return data as JSON using HTTP GET method:   http://username:password@crossbrowsertesting.com/api/screenshots/show?format=json&page=2
Sample Result:
<?xml version="1.0" encoding="utf-8" ?>
<tests>
    <test>
        <id>2691</id>
        <url>http://www.google.com/</url>
        <test_api_show_url>http://crossbrowsertesting.com/api/screenshots/2691/show</test_api_show_url>
        <test_date>2009-11-29 11:24:09</test_date>
    </test>
    <test>
        <id>2388</id>
        <url>http://www.yahoo.com/</url>
        <test_api_show_url>http://crossbrowsertesting.com/api/screenshots/2388/show</test_api_show_url>
        <test_date>2009-11-22 10:19:08</test_date>
    </test>
...
</tests>

This api call returns a repeating element of <test> tags, one for each automated screenshot test ran in order of most recent to oldest.

  • <id> - unique ID for this test (needed for additional API calls)
  • <url> - the URL of the page screenshots were requested for
  • <test_api_show_url> - the API URL for retrieving screenshot versions
  • <test_date> - the date/time this test was run

Show Screenshot Test Versions 

Returns a list of versions for an automated screenshot test

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/<test id>/show
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
page<integer>1falseSpecify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299.
Examples:
return data as XML using HTTP GET method:   http://username:password@crossbrowsertesting.com/api/screenshots/536/show?format=xml
Sample Result:
<?xml version="1.0" encoding="utf-8" ?>
<test>
    <id>536</id>
    <url>http://www.vmware.com/</url>
    <test_date>2009-09-26 21:32</test_date>
    <versions>
        <version>
            <version_api_show_url>http://crossbrowsertesting.com/api/screenshots/536/version/936/show</version_api_show_url>
            <version_api_run_url>http://crossbrowsertesting.com/api/screenshots/536/version/936/run</version_api_run_url>
            <version_ui_url>http://crossbrowsertesting.com/users/username/screenshots/536/936</version_ui_url>
            <version_zip>http://crossbrowsertesting.com/users/username/screenshots/536/936/zip</version_zip>
            <id>936</id>
            <version_date>2009-09-26 21:32</version_date>
            <count_successful>10</count_successful>
            <count_not_finished>0</count_not_finished>
        </version>
    </versions>
</test>

This api call returns a repeating element of <version> tags, one for each version of an automated screenshot test run on our system, in order of most recent to oldest.

  • <version_api_show_url> - the API URL for retrieving screenshot results for this test version
  • <version_api_run_url> - the API URL for repeating this automated screenshot test version
  • <version_ui_url> - the URL for viewing a web page of the screenshot results for this test version
  • <version_zip> - the URL for downloading a zip file of all successful screenshot results from this test version
  • <id> - unique ID of this test version needed for additional API calls
  • <version_date> - the date/time this test version was run
  • <count_successful> - the count of successful screenshots taken during this test
  • <count_not_finished> - the count of screenshots taken during this test that were unsuccessful

Show Screenshot Test Version Results 

Returns a list of screenshot results from a single version of an automated test

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/<test id>/version/<version id>/show
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
page<integer>1falseSpecify the page of results to return. There are 100 results per page, such that page=3 will return results 200-299.
Examples:
return data as XML using HTTP GET method:   http://username:password@crossbrowsertesting.com/api/screenshots/536/version/321/show
Sample Result:
...
<result>
    <id>6772</id>
    <start_date>2009-09-26 21:32:55</start_date>
    <finished_date>2009-09-26 21:33</finished_date>
    <status>complete</status>
    <os>Mac OSX 10.5.8</os>
    <browser>Safari 4</browser>
    <resolution>1024x768</resolution>
    <live_test_url>http://crossbrowsertesting.com/console.php?tloid=6772</live_test_url>
    <windowed_thumb>http://media.crossbrowsertesting.com/users/1/screenshots/window/thumbs/zc154fb5f8fb267d278a.png</windowed_thumb>
    <windowed>http://media.crossbrowsertesting.com/users/1/screenshots/window/zc154fb5f8fb267d278a.png</windowed>
    <full_page_thumb>http://media.crossbrowsertesting.com/users/1/screenshots/full/thumbs/zc154fb5f8fb267d278a.png</full_page_thumb>
    <full_page>http://media.crossbrowsertesting.com/users/1/screenshots/full/zc154fb5f8fb267d278a.png</full_page>
</result>
...

This api call returns a repeating element of <result> tags, one for each OS, browser, resolution requested for this screenshot test.

  • <id> - unique ID for this screenshot result
  • <start_date> - date/time screenshot started
  • <finished_date> - date/time screenshot finished
  • <status> - current status of the screenshot
  • <os> - operating system
  • <browser> - browser
  • <resolution> - resolution
  • <live_test_url> - URL for viewing the page in a Live Test session
  • <windowed_thumb> - thumbnail of the windowed screenshot
  • <windowed> - windowed screenshot
  • <full_page_thumb> - thumbnail of the full page screenshot
  • <full_page> - full page screenshot

Run Automated Screenshots 

Run a new version of an existing screenshot test

API Call:
URL: http://crossbrowsertesting.com/api/screenshots/<test id>/version/<version id>/run
HTTP Method: GET or POST
Requires Authentication: true
Parameters:
ParamValueDefaultRequiredDescription
formatxml,jsonxmlfalseThe format of the returned data.
urlhttp://www.yourdomain.com<original url>falseIf not supplied, repeats test on same URL. If supplied, performs same browser tests across new URL.
Examples:
repeat test:   http://crossbrowsertesting.com/api/screenshots/1234/version/123456/run
repeat test on new URL:   http://crossbrowsertesting.com/api/screenshots/1234/version/123456/run?url=http://www.domain.com/newpage