The CrossBrowserTesting 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.
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.
Base URL
The base URL for API calls is:
https://crossbrowsertesting.com/api/v3/All requests are sent over a secure HTTPS connection.
Authentication
Users must authenticate via Basic authentication for every API request using their email/username and authkey
for password.
Authentication can be achieved by passing the credentials in the URL, like:
https://{username}:{authkey}@crossbrowsertesting.com/api/v3/screenshots
Or, using a language implementation like cURL:
curl --user {username}:{authkey} https://crossbrowsertesting.com/api/v3/livetests
Reference
OpenAPI definition
The CrossBrowserTesting API is defined using OpenAPI (Swagger) JSON files. These files can be used with multiple tools and imported into applications like SoapUI or Swagger Inspector which tells the tools everything about the API and how to use it.
Examples
Some cURL examples would look like the following.
This will run a Live Test on a Mac 10.11 using Safari 9 at 1024×768 pixels:
cURL
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
curl https://{username}:{authkey}@crossbrowsertesting.com/api/v3/selenium
This will run a Screenshot Test on Mac 10.11 using Safari 9 at 1024×768 pixels and Windows 10 using Edge 20 at 800×600 pixels:
cURL
curl --user {username}:{authkey} --data "browser=Mac10.11|Safari9|1024x768&browsers=Win10|Edge20|800x600&url=http://yourwebpage.com" https://crossbrowsertesting.com/api/v3/screenshots/