Overview
The Visual Assertion step leverages AI to create intelligent visual assertions using natural language instructions. Instead of writing traditional code-based assertions, you can describe what you want to verify in plain English. Optionally, you can target specific elements for more precise validation.Form Fields
Field Name | Type | Required | Description |
---|---|---|---|
Assertion Text | textarea | Yes | Natural language description of what to assert |
Element Target | button | No | Optional element picker to target specific page elements |
Form Configuration
Assertion Text Field
- Natural Language: Write assertions in plain English describing expected behavior
- Multi-line Support: Can handle complex, detailed assertion descriptions
- Required Field: Must provide meaningful assertion instruction
Element Target Picker
- Optional Targeting: Click the diamond icon to activate element picker mode
- Visual Selection: Select specific elements on the page for focused assertions
- Target Status: Shows confirmation when element is successfully selected
- Update Target: Can change or update the selected target element
Examples
Basic Text Assertions
Simple content verification without element targeting:Element-Targeted Assertions
Focused assertions on specific page elements: Target: Header navigation elementComplex Behavior Assertions
Sophisticated checks involving multiple conditions:Negative Assertions
Verifying things that should NOT happen:Best Practices
Writing Effective Assertions
- Be Specific: Provide clear, detailed descriptions of expected behavior
- Use Context: Include relevant context about what should happen when
- Avoid Ambiguity: Write assertions that have clear pass/fail criteria
- Include Edge Cases: Consider error states and boundary conditions
Element Targeting Strategy
- Target When Needed: Use element targeting for focused, specific checks
- Stable Elements: Target elements with stable, reliable selectors
- Logical Grouping: Target container elements when checking multiple related items
- Visual Context: Select elements that provide good visual context for the assertion
Natural Language Guidelines
- Conversational Tone: Write as if explaining to a colleague what should happen
- Action-Oriented: Focus on behaviors and outcomes rather than technical details
- Complete Thoughts: Ensure assertions form complete, understandable statements
- Consistent Terminology: Use consistent language patterns across related assertions
Common Issues
Vague Assertions
- Problem: Assertion is too general or ambiguous to validate reliably
- Solution: Provide more specific, measurable criteria in the assertion text
- Example: Instead of “page looks good”, use “header navigation is visible and all links are functional”
Missing Context
- Problem: Assertion doesn’t provide enough context for AI to understand intent
- Solution: Include relevant context about when and how the assertion should pass
- Prevention: Write assertions as complete thoughts explaining expected behavior
Element Target Issues
- Problem: Selected element is not stable or becomes unavailable
- Solution: Target parent containers or more stable elements
- Debugging: Test element targeting independently before running full assertions
Overly Complex Assertions
- Problem: Single assertion tries to validate too many different behaviors
- Solution: Break complex assertions into multiple, focused validation steps
- Best Practice: Each assertion should have a single, clear validation purpose
Related Steps
- Verify Text - For simple text content verification
- Verify Visibility - For basic element visibility checks
- Extract Text - For capturing text used in visual assertions
- Wait for Element - For ensuring elements are ready before assertion
- Navigate - For setting up page context before assertions