What are Smart Screenshots?
How does Smart Screenshots really work? When a test is created and every time its run, we collect data at every step to intelligently select the proper element. Along with this machine learning data, we also collect screenshots at every step. These screenshots help you diagnose errors and also help us verify that the selection and interaction was performed correctly. Given all of this data, we can map the machine learning data directly to the screenshot. This means that when you want to edit tests, you can directly make certain changes straight from the screenshot.
Note: Smart Screenshots are not available in certain situations:
- Page Objects do not support Smart Screenshots yet
- ML Data must have been collected for the previous step's execution (only executions in April 2021+ are supported)
- Sometimes ML data cannot be collected for a variety of reasons, try executing the test again if smart screenshots are not working as expected
Let's look at three of these Smart Screenshot features:
- Quick Select allows you to update the element. Since we already know all the elements on the screen as they relate to the screenshot, you can simply click on a different element. This can be used in a variety of use cases, for example: if your site has changed and we did not heal correctly or if you selected the wrong element for some reason.
- Quick Add Actions allows you to update your test to include certain types of actions if the previous step has ML data to read from. Some steps, like PageInits, do not pull ML data so this option is not always available.
- SmartFix recommends updates to your test if the test has failed. When there are element suggestions, you can select one of the suggested elements, or you can select any element, just like Quick Select.