We're excited to share a new option for GenAI Assertions: GenAI Screen Capture!
Previously, if you wanted to create a GenAI Assertion for the entire page, you had to hold down the [SHIFT] key and use the up and down arrow keys to highlight different elements until you targeted the full page. GenAI Screen Capture simplifies the process of asserting on the entire viewport, which can be especially useful when you want to consider the full context of the page, including...
- Evaluating the state of the page, such as verifying that a user is logged in or logged out
- Performing a comprehensive evaluation, such as asserting that the page is in a specific language
Try it out
To add a GenAI Screen Capture assertion to a browser or mobile test, launch the mabl Trainer and get your application in the desired state. Then take the following steps:
- Click on the check mark icon to create a new assertion.
- Click on the GenAI Screen Capture button in the Trainer window.
- Describe what you want to verify in the Assertion description field. Your assertion description can include references to variables used in the test, including values from DataTables and other data-driven variables. For example, "Verify that the results are relevant to {{@search_input}}."
- Click on Test assertion. The first time you test the assertion, mabl generates assertion criteria. This criteria is sent with the assertion description to the LLM to provide a consistent set of criteria to evaluate as part of your assertion. If you iterate on the assertion description, mabl updates the assertion criteria to reflect the current state of the description.
- Choose a behavior on failure. By default, GenAI Assertions are set to "Fail at end of test."
- Click OK.
GenAI Screen Capture is not currently supported for conditional steps.
Viewport size
GenAI Screen Capture evaluates based on the screenshot of the visible portion of the page, not the DOM or the page source. If you assert on something that isn't fully visible in the viewport, such as a long table, the off-screen portion will not be included.
In browser tests, you can resize the page to include larger elements using a "Set viewport" step. "Set viewport" steps ensure that your GenAI Assertions use the same viewport size during both training and execution.