Overview

The Dynamic Assertion step leverages AI to create intelligent test 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 NameTypeRequiredDescription
Assertion TexttextareaYesNatural language description of what to assert
Element TargetbuttonNoOptional 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:
Check that the page displays "Welcome, John Doe"
Verify the success message appears after form submission
Ensure the error notification is not visible

Element-Targeted Assertions

Focused assertions on specific page elements: Target: Header navigation element
Verify that all main navigation links are visible and clickable
Target: Shopping cart icon
Check that the cart shows 3 items and displays the correct total
Target: Form validation area
Ensure error messages appear for empty required fields

Complex Behavior Assertions

Sophisticated checks involving multiple conditions:
Verify that clicking the dropdown reveals all available options, each option is selectable, and the selected value updates the form correctly
Check that the data table loads with correct sorting, pagination works properly, and all action buttons are functional
Ensure the modal opens with proper animations, contains expected content, and closes when clicking outside or on the X button

Negative Assertions

Verifying things that should NOT happen:
Ensure no error messages are displayed when form is submitted with valid data
Verify that premium features are not accessible for free tier users
Check that deleted items do not appear in the search results

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