API Documentation

Automated screenshot methods

Allows the automation of screenshot tests. Allows tests to be run and the results to be viewed. When running a new test, it will be based on an existing test. This will determine the browser configurations to use for the test.

Methods:

screenshots/show - show the screenshot tests you have taken

screenshots/<test id>/show - Returns versions of a test

screenshots/<test id>/version/<version id>/show - show the results of a screenshot test

screenshots/<test id>/version/<version id>/run - run a new screenshot test




Automated screenshot methods

Allows the automation of screenshot tests. Allows tests to be run and the results to be viewed. When running a new test, it will be based on an existing test. This will determine the browser configurations to use for the test.

screenshots/show - show the screenshot tests you have taken

Returns screenshots tests that have been run

Url:
http://crossbrowsertesting.com/api/screenshots/show

Http method:
GET, POST

Requires authentication:
true

Parameters:
  • format: Optional. Return format. xml for xml, json for json
  • page: Optional. Specify the page of results to return. Default 1. The 100 most recent screenshot tests are returned. If you need to access older screenshots, specify page 2 to get the next 100-199, page 3 for 200-299.

Examples:
pull data back in XML
curl --user username:password http://crossbrowsertesting.com/api/screenshots/show

pull data back in json
curl -d format=json --user username:password http://crossbrowsertesting.com/api/screenshots/show


Here is some sample output
<?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>

The idea is that you will get back a number that tells you how many screenshot tests you have run (in my example it is 51). Then there will be a repeating element of test tags.

Each test tag has the id that you can use on other API calls, the API url to show you more information and the date of the test and of course the URL you were testing.



screenshots/<test id>/show - Returns versions of a test

Returns versions of a test that has been run

Url:
http://crossbrowsertesting.com/api/screenshots/<test id>/show

Http method:
GET, POST

Requires authentication:
true

Parameters:
  • format: Optional. Return format. xml for xml, json for json
  • page: Optional. Specify the page of results to return. Default 1. The 100 most recent screenshot tests are returned. If you need to access older screenshots, specify page 2 to get the next 100-199, page 3 for 200-299.

Examples:
http://crossbrowsertesting.com/api/screenshots/9992/show

Here is some output from one of my tests
<?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/tonetheman/screenshots/536/936</version_ui_url>
			<version_zip>http://crossbrowsertesting.com/users/tonetheman/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>

The id is the test id that you get from when you list the screenshots with screenshots/show, the URL is the url that was used for this test, the test_date is the date and time that the test was run. Next is a list of version xml structures.

Each version has a api_show_url (which can be used to get more information), a run_api_url that can be used to re-run this version of a test, a ui_url so you can see a web page of what this version looked like and a version zip url to get a file of screenshots zipped up, a version id (to uniquely identify this version, when this version of the screenshot tests were run, the count of successful screenshots and the count of not finished screenshots.



screenshots/<test id>/version/<version id>/show - show the results of a screenshot test

Returns data from a single version of a test that has been run

Url:
http://crossbrowsertesting.com/api/screenshots/<test id>//show

Http method:
GET, POST

Requires authentication:
true

Parameters:
  • format: Optional. Return format. xml for xml, json for json
  • page: Optional. Specify the page of results to return. Default 1. The 100 most recent screenshot tests are returned. If you need to access older screenshots, specify page 2 to get the next 100-199, page 3 for 200-299.

Examples:
http://crossbrowsertesting.com/api/screenshots/9992/version/321/show

This contains information about the version of the screenshot test at the top of the XML. There is also an array of result xml structures.
Each result has an internal id to make it unique, a start time and end time, a status, the OS it was run on, the browser it was run against, the resolution that was used, then a set of thumbnails that can be used to display the screenshot and then the screenshot url itself (windowed and full).

There is one result xml structure for each screenshot in a test.
			<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://crossbrowsertesting.com/u/tonetheman/screens/thumb/zc154fb5f8fb267d278a.png</windowed_thumb>
					<windowed>http://crossbrowsertesting.com/u/tonetheman/screens/full/zc154fb5f8fb267d278a.png</windowed>
					<full_page_thumb>http://crossbrowsertesting.com/u/tonetheman/screens/thumbpage/zc154fb5f8fb267d278a.png</full_page_thumb>
					<full_page>http://crossbrowsertesting.com/u/tonetheman/screens/fullpage/zc154fb5f8fb267d278a.png</full_page>
				</result>



screenshots/<test id>/version/<version id>/run - run a new screenshot test

run a version of a screenshot test

Url:
http://crossbrowsertesting.com/api/screenshots/<test id>/version/<test id>/run

Http method:
GET, POST

Requires authentication:
true

Parameters:
  • format: Optional. Return format. xml for xml, json for json
  • url: Optional. run this new url on the same set of OS/browser combinations that you ran before. this will return a new test

Examples:
http://crossbrowsertesting.com/api/screenshots/9992/version/321/run
http://crossbrowsertesting.com/api/screenshots/9992/version/321/run?url=http://www.yahoo.com