Web Sites
A web site object describes a particular web site you test. To test a site multiple
times, you do not need to create new web sites objects. For example, if you have already
set up a web site to test http://example.com, you can trigger a test to run by
creating a new test run. Web sites created
via the API are accessible from the web UI and vice versa, so you can always manually
manage them.
The API supports three actions:
list (show all of your web sites), create (a new web site to test), and view
(show details for one web site).
Listing Web Sites
You can retrieve the list of all of your web sites with this API call. The fields
returned are the same as those from the viewing action.
Example response:
GET https://api.browsera.com/v0.1a/web_sites.xml?api_key=YOUR_API_KEY
Example response:
GET https://api.browsera.com/v0.1a/web_sites.xml?api_key=YOUR_API_KEY
<?xml version="1.0" encoding="UTF-8"?> <web_sites type="array"> <web_site> <name>Google</name> <id>1</id> <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>Safari 9</browser> <browser>Safari 10</browser> <browser>Firefox 56</browser> <browser>Firefox 57</browser> <browser>Chrome 87</browser> </browsers> <urls type="array"> <url>http://google.com</url> </urls> <max_crawl_pages>3</max_crawl_pages> <exclude_crawl_pages type="array"> <url_match>logout</url_match> <url_match>blog</url_match> </exclude_crawl_pages> <repeat_test_in_weeks>2</repeat_test_in_weeks> <site_login> <user_name>testuser</user_name> <password>secret</password> <website_login>true</website_login> <login_page_url>https://www.google.com/accounts/Login?hl=en&continue=http://www.google.com/%23q%3Dlogin%26hl%3Den</login_page_url> <user_name_input_id>email</user_name_input_id> <password_input_id>password</password_input_id> <submit_input_id></submit_input_id> <submit_javascript></submit_javascript> </site_login> <test_runs type="array"> </test_runs> </web_site> <web_site> <name>Apple Website</name> <id>2</id> <baseline_browser>Chrome 87</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>Safari 9</browser> <browser>Safari 10</browser> <browser>Firefox 56</browser> <browser>Firefox 57</browser> <browser>Chrome 87</browser> </browsers> <urls type="array"> <url>http://apple.com</url> </urls> <max_crawl_pages>3</max_crawl_pages> <exclude_crawl_pages type="array"> </exclude_crawl_pages> <test_runs type="array"> </test_runs> </web_site> </web_sites>
Creating Web Sites
You can create a new web site with this API call. Note that a test run will NOT be
created.
Example request:
POST https://api.browsera.com/v0.1a/web_sites.xml?api_key=YOUR_API_KEY
Post data body:
Example request:
POST https://api.browsera.com/v0.1a/web_sites.xml?api_key=YOUR_API_KEY
Post data body:
<?xml version="1.0" encoding="UTF-8"?> <web_site> <name>Google</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>Safari 9</browser> <browser>Safari 10</browser> <browser>Firefox 56</browser> <browser>Firefox 57</browser> <browser>Chrome 87</browser> </browsers> <urls type="array"> <url>http://google.com</url> </urls> <max_crawl_pages>3</max_crawl_pages> <exclude_crawl_pages type="array"> <url_match>logout</url_match> <url_match>blog</url_match> </exclude_crawl_pages> <repeat_test_in_weeks>2</repeat_test_in_weeks> <site_login> <user_name>testuser</user_name> <password>secret</password> <website_login>true</website_login> <login_page_url>https://www.google.com/accounts/Login?hl=en&continue=http://www.google.com/%23q%3Dlogin%26hl%3Den</login_page_url> <user_name_input_id>email</user_name_input_id> <password_input_id>password</password_input_id> <submit_input_id></submit_input_id> <submit_javascript></submit_javascript> </site_login> <test_runs type="array"> </test_runs> </web_site>
Viewing Web Sites
This API is used to view the details of a single web site. The fields returned are the same
as those from the listing action.
Example response:
GET https://api.browsera.com/v0.1a/web_sites/1.xml?api_key=YOUR_API_KEY
Example response:
GET https://api.browsera.com/v0.1a/web_sites/1.xml?api_key=YOUR_API_KEY
<?xml version="1.0" encoding="UTF-8"?> <web_site> <name>Google</name> <id>1</id> <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>Safari 9</browser> <browser>Safari 10</browser> <browser>Firefox 56</browser> <browser>Firefox 57</browser> <browser>Chrome 87</browser> </browsers> <urls type="array"> <url>http://google.com</url> </urls> <max_crawl_pages>3</max_crawl_pages> <exclude_crawl_pages type="array"> <url_match>logout</url_match> <url_match>blog</url_match> </exclude_crawl_pages> <repeat_test_in_weeks>2</repeat_test_in_weeks> <site_login> <user_name>testuser</user_name> <password>secret</password> <website_login>true</website_login> <login_page_url>https://www.google.com/accounts/Login?hl=en&continue=http://www.google.com/%23q%3Dlogin%26hl%3Den</login_page_url> <user_name_input_id>email</user_name_input_id> <password_input_id>password</password_input_id> <submit_input_id></submit_input_id> <submit_javascript></submit_javascript> </site_login> <test_runs type="array"> </test_runs> </web_site>