Skip to content

Screenshots

Screenshots show what the application looked like at every step of a test.

They help provide visual evidence to show how the application responds to user actions, making it easier to debug issues and understand failures at a glance.

Automatic screenshots

Our philosophy is to keep tests readable and focused on the user journey.

Instead of cluttering test scripts with utility calls like taking screenshots, UI-licious captures screenshots automatically at every command, and saves it to the cloud alongside test reports.

In most cases, screenshots are taken after a command to show the resulting state of the application.

The only exception is the I.click() command — wherein screenshots are taken before the click to highlight the element that will be clicked. If you need a screenshot of the state after the click, follow it with any non-interactive command, such as I.wait() or TEST.log.info():

js
I.click("Login")

I.wait(1) // take a screenshot after waiting
TEST.log.info("User is logged in") // take a screenshot with a custom message

Disabling automatic screenshots

In some cases, you may want to temporarily disable automatic screenshots:

  • on pages that display sensitive and confidential information
  • to speed up test execution by skipping image capture

To disable automatic screenshots, set TEST.autoScreenshot to false. This can be disabled and re-enabled at any point in the test.

js
// disable screenshot
TEST.autoScreenshot = false
I.click("Copy secret pass phrase")
I.click("Next")

// re-enable screenshot
TEST.autoScreenshot = true