Test Runs

A test run object represents a completed or running test. Each test run must be associated with one of your web sites. If you wish to test a site you have never tested before, you must first create a web site. Test runs created via the API are accessible from the web UI and vice versa.

The API supports three actions: list (show all tests for the web site), create (start a new test), and view (show details for one test).

Listing Test Runs

You can retrieve the list of all test runs that have been previously run or triggered to run with this API call. The sample response shows one test run which has been created but has not started, and another that has completed. The fields returned are the same as those from the viewing action.

Example response:
GET https://api.browsera.com/v0.1a/web_sites/1/test_runs.xml?api_key=YOUR_API_KEY
<?xml version="1.0" encoding="UTF-8"?>
<test_runs type="array">
  <test_run>
    <id>2</id>
    <name>Alpha Test 12-14-2017</name>
    <created_at>2017-12-14 20:31:02 -0800</created_at>
    <status>Not Started</status>
    <completion_percentage>0</completion_percentage>
    <baseline_browser>Internet Explorer 6</baseline_browser>
    <browsers type="array">
      <browser>Internet Explorer 6</browser>
      <browser>Internet Explorer 7</browser>
      <browser>Internet Explorer 8</browser>
      <browser>Internet Explorer 9</browser>
      <browser>Safari 6</browser>
      <browser>Internet Explorer 10</browser>
      <browser>Internet Explorer 11</browser>
      <browser>Safari 7</browser>
      <browser>Safari 8</browser>
      <browser>Firefox 46</browser>
      <browser>Firefox 47</browser>
      <browser>Safari 9</browser>
      <browser>Safari 10</browser>
      <browser>Chrome 56</browser>
      <browser>Firefox 50</browser>
    </browsers>
  </test_run>
  <test_run>
    <id>1</id>
    <name>Alpha Test 12-14-2017</name>
    <created_at>2017-12-14 19:31:02 -0800</created_at>
    <status>Complete</status>
    <completion_percentage>0</completion_percentage>
    <baseline_browser>Internet Explorer 6</baseline_browser>
    <browsers type="array">
      <browser>Internet Explorer 6</browser>
      <browser>Internet Explorer 7</browser>
      <browser>Internet Explorer 8</browser>
      <browser>Internet Explorer 9</browser>
      <browser>Safari 6</browser>
      <browser>Internet Explorer 10</browser>
      <browser>Internet Explorer 11</browser>
      <browser>Safari 7</browser>
      <browser>Safari 8</browser>
      <browser>Firefox 46</browser>
      <browser>Firefox 47</browser>
      <browser>Safari 9</browser>
      <browser>Safari 10</browser>
      <browser>Chrome 56</browser>
      <browser>Firefox 50</browser>
    </browsers>
    <web_pages type="array">
      <web_page>
        <url>http://www.apple.com</url>
        <title>Apple</title>
        <number_of_layout_differences>0</number_of_layout_differences>
        <browser_renderings type="array">
          <browser_rendering>
            <browser>Firefox 3.5</browser>
            <low_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-3.5.screenshot.thumb.jpg</low_res_image_url>
            <high_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-3.5.screenshot.jpg</high_res_image_url>
            <javascript_errors type="array">
              <javascript_error>(line 0): uncaught exception: Permission denied to get property Window.alert</javascript_error>
            </javascript_errors>
          </browser_rendering>
          <browser_rendering>
            <browser>Internet Explorer 7</browser>
            <low_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Internet-Explorer-7.screenshot.thumb.jpg</low_res_image_url>
            <high_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Internet-Explorer-7.screenshot.jpg</high_res_image_url>
            <javascript_errors type="array">
            </javascript_errors>
          </browser_rendering>
          <browser_rendering>
            <browser>Firefox 2</browser>
            <low_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-2.screenshot.thumb.jpg</low_res_image_url>
            <high_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-2.screenshot.jpg</high_res_image_url>
            <javascript_errors type="array">
              <javascript_error>(line 0): uncaught exception: Permission denied to get property Window.alert</javascript_error>
            </javascript_errors>
          </browser_rendering>
        </browser_renderings>
      </web_page>
    </web_pages>
  </test_run>
</test_runs>

Creating Test Runs

Creating a test run triggers the test to execute on our system. The response returned will be the same as the viewing API and contain the 'id' assigned to the run. The test can then be polled for status by using the "Viewing Test Runs" method below.

The 'baseline_browser' and 'browsers' fields are optional. If specified, they will modify the corresponding Web Site object's baseline browser and browsers.

Example request:
POST https://api.browsera.com/v0.1a/web_sites/1/test_runs.xml?api_key=YOUR_API_KEY
Post data body:
<?xml version="1.0" encoding="UTF-8"?>
<test_run>
  <name>Dev Test 12-14-2017</name>
  <baseline_browser>Internet Explorer 6</baseline_browser>
  <browsers type="array">
    <browser>Internet Explorer 6</browser>
    <browser>Internet Explorer 7</browser>
    <browser>Internet Explorer 8</browser>
    <browser>Internet Explorer 9</browser>
    <browser>Safari 6</browser>
    <browser>Internet Explorer 10</browser>
    <browser>Internet Explorer 11</browser>
    <browser>Safari 7</browser>
    <browser>Safari 8</browser>
    <browser>Firefox 46</browser>
    <browser>Firefox 47</browser>
    <browser>Safari 9</browser>
    <browser>Safari 10</browser>
    <browser>Chrome 56</browser>
    <browser>Firefox 50</browser>
  </browsers>
</test_run>

Viewing Test Runs

Use this API to check the status of a running or completed test. Test runs will contain much more information once their status has reached the 'Complete' state. For example, the web pages tested and details for each browser including links to screenshots will be returned. The fields returned are the same as those from the listing action.

Example response:
GET https://api.browsera.com/v0.1a/web_sites/1/test_runs/1.xml?api_key=YOUR_API_KEY
<?xml version="1.0" encoding="UTF-8"?>
<test_run>
  <id>1</id>
  <name>Alpha Test 12-14-2017</name>
  <created_at>2017-12-14 19:31:02 -0800</created_at>
  <status>Complete</status>
  <completion_percentage>0</completion_percentage>
  <baseline_browser>Internet Explorer 6</baseline_browser>
  <browsers type="array">
    <browser>Internet Explorer 6</browser>
    <browser>Internet Explorer 7</browser>
    <browser>Internet Explorer 8</browser>
    <browser>Internet Explorer 9</browser>
    <browser>Safari 6</browser>
    <browser>Internet Explorer 10</browser>
    <browser>Internet Explorer 11</browser>
    <browser>Safari 7</browser>
    <browser>Safari 8</browser>
    <browser>Firefox 46</browser>
    <browser>Firefox 47</browser>
    <browser>Safari 9</browser>
    <browser>Safari 10</browser>
    <browser>Chrome 56</browser>
    <browser>Firefox 50</browser>
  </browsers>
  <web_pages type="array">
    <web_page>
      <url>http://www.apple.com</url>
      <title>Apple</title>
      <number_of_layout_differences>0</number_of_layout_differences>
      <browser_renderings type="array">
        <browser_rendering>
          <browser>Firefox 3.5</browser>
          <low_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-3.5.screenshot.thumb.jpg</low_res_image_url>
          <high_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-3.5.screenshot.jpg</high_res_image_url>
          <javascript_errors type="array">
            <javascript_error>(line 0): uncaught exception: Permission denied to get property Window.alert</javascript_error>
          </javascript_errors>
        </browser_rendering>
        <browser_rendering>
          <browser>Internet Explorer 7</browser>
          <low_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Internet-Explorer-7.screenshot.thumb.jpg</low_res_image_url>
          <high_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Internet-Explorer-7.screenshot.jpg</high_res_image_url>
          <javascript_errors type="array">
          </javascript_errors>
        </browser_rendering>
        <browser_rendering>
          <browser>Firefox 2</browser>
          <low_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-2.screenshot.thumb.jpg</low_res_image_url>
          <high_res_image_url>https://s3.amazonaws.com/browsera-renderings-prod/00001-www.browsera.com%2F05293-Apple%2F35171%2Fa54c34ef-8bae-4066-a830-6c706f2a23fe/Firefox-2.screenshot.jpg</high_res_image_url>
          <javascript_errors type="array">
            <javascript_error>(line 0): uncaught exception: Permission denied to get property Window.alert</javascript_error>
          </javascript_errors>
        </browser_rendering>
      </browser_renderings>
    </web_page>
  </web_pages>
</test_run>