The CrossBrowserTesting.com API allows you to implement our browser testing services within your own web and desktop applications via HTTP, enabling you to customize your website-testing process and workflow.

API Versions

The current API version is 3.0 for both Automated Screenshot Tests and Live Tests.

The version of the API is specified in the URL structure like so:

https://crossbrowsertesting.com/api/v3/

What can be done with API?

  • Run Live Tests: Take Snapshots, Record Videos, Record Network Packet Captures, and more
  • Retrieve Live Test results
  • Selenium Tests: Take Snapshots, Record Videos, Record Network Packet Captures, and more
  • Retrieve Selenium Test results
  • Run Automated Screenshot Tests: Repeat full tests, Retake a single screenshot
  • Retrieve Screenshot Test results
  • Get Screenshot Comparison results

Documentation

Sample Scripts

Swagger.io

The CrossBrowserTesting.com API is defined using Swagger.io JSON files. These files can be used with multiple tools and imported into applications like SoapUI which tells the tool everything about the API and how to use it.

Authenticating

Users must authenticate via Basic Authentication for every API request using their login credentials. Beggining with API version 3.0, users can use their authkey instead of their password.

Authentication can be achieved by passing the credentials in the URL, like:

https://{username}:[email protected]/api/v3/screenshots

Or, using a language implementation, like Linux "curl":

curl --user {username}:{authkey} https://crossbrowsertesting.com/api/v3/livetests

Examples

Some curl examples would look like the following:

This will run a Live Test on a Mac 10.11 using Safari 9 at 1024x768 pixels.

curl --user {username}:{authkey} --data "browser=Mac10.11|Safari9|1024x768&url=http://yourwebpage.com" https://crossbrowsertesting.com/api/v3/livetests

This will get your Selenium Test History.

curl https://{username}:[email protected]/api/v3/selenium

This will run a Screenshot Test on Mac 10.11 using Safari 9 at 1024x768 pixels and Windows 10 using Edge 20 at 800x600 pixels.

curl --user {username}:{authkey} --data "browser=Mac10.11|Safari9|1024x768&browsers=Win10|Edge20|800x600&url=http://yourwebpage.com" https://crossbrowsertesting.com/api/v3/screenshots/

Sample Scripts