The screenshot engine we use is designed to do one test at a time – feed it a URL, and it runs a test. Unfortunately, this doesn’t lend itself well to doing large-scale visual tests of your entire site.
Fortunately, our API makes it easy to automate this process and run it on a regular schedule.
NEW! In App Screenshot Scheduling Tool
You will need a plan that allows for automated testing to be able to to make the API calls required. If you are not currently on our Automated or Unlimited plans, you will need to upgrade to be able to automate the screenshot process in this way.
Generating a list of URLs
In order to test a set of pages, you will need to create a list of those pages. If you have a sitemap.xml file, this can be parsed to give you the list; alternatively, you can use a tool like wget to generate a list of the pages of the site, or you can manually generate the list of pages. An advantage of manually generating the list is that you have more control over what gets tested and how – for example, you can specify login profiles or Selenium scripts to run on certain pages, or even use the tool to automatically check how a page looks logged in versus logged out.
Running screenshot tests
To run the screenshot tests, you will need to make API calls to our screenshot API (documented here). Once the test has been initiated, you will need to wait for it to finish – please note that the response will come back immediately, but the test itself may not finish for some time, so you can query the API to wait for the test to finish.
Note that screenshots started via the API count against your parallel automated tests, so you can run up to as many tests concurrently as you have parallel tests to handle.
There is an example of using our screenshot API available in PowerShell , but it’s relatively straightforward and can be used as a reference for making your own scripts to call the API.
If you want to track the changes in a page over time, the best option is to use the versions functionality in the screenshot engine. To do this, you will need to track the screenshot test ID and version IDs – something like SQLite may be a good fit for this sort of tracking.
If you have any questions, feel free to reach out to our support team any time.