Skip to main content
AI Action is a step type you add to your test — like Click or Fill, but powered by AI. Looking to auto-generate an entire test from scenario notes? See AI Action Agent instead.

What is AI Action?

AI Action is a step type that understands natural language and performs complex browser interactions. You write a prompt describing what you want, and the AI executes it directly in the browser — no selectors needed. AI Action lives alongside your other steps. It’s perfect for interactions that are too complex or dynamic for traditional Click/Fill steps.
AI Action in a test case

How AI Action Works

Unlike traditional automation that relies on CSS selectors or XPath to find elements, AI Action uses vision-based understanding to interact with your application exactly like a human would.

AI Action vs Traditional Steps

AspectTraditional StepsAI Action
Element FindingCSS selectors, XPathVisual understanding of UI
When UI ChangesBreaks if selectors changeAdapts automatically
Dynamic ContentRequires complex logicHandles naturally
Multi-step FlowsMany individual stepsSingle prompt
Human-like DecisionsNot possibleReads, interprets, decides

What Makes It Different

  • Sees the page: Understands visual layout, not just DOM structure
  • Context-aware: Knows what “the login button” means even without exact selectors
  • Self-correcting: Adapts when elements move or change styling
  • Intelligent waits: Understands loading states and UI transitions

When AI Action Shines

Perfect Scenarios

Dynamic, Complex Interactions:
  • Forms that change based on previous inputs
  • Search features with autocomplete and suggestions
  • Admin dashboards with conditional logic
  • Multi-step wizards where each step depends on the previous
Human-Like Decision Making:
  • Choosing options from a list based on visible data
  • Reading and interpreting text, numbers, or visual information
  • Finding elements that may have moved or changed
  • Recovering gracefully from unexpected page states
Real-World Examples:
  • “Complete the checkout process with test payment information”
  • “Find the user with email ‘[email protected]’ and update their role to Admin”
  • “Navigate through settings and enable two-factor authentication”
How AI Action works

When to Use Traditional Steps Instead

Stick with basic steps for:
  • Simple button clicks → use Click
  • Straightforward form filling → use Fill
  • Navigation to known URLs → use Navigate
  • Performance-critical repetitive actions
  • API testing for backend functionality
Use AI Action when the interaction requires understanding context, making decisions, or handling dynamic behavior. Use traditional steps for predictable, high-frequency actions.

Getting Started

Adding an AI Action Step

  1. Click the Add button in the test editor
  2. Select AI Action from the step menu
  3. Write your prompt describing what you want to accomplish
  4. Run the step and watch the AI perform the action
Adding an AI Action step

Watching It Work

  • Live Preview: See exactly what the AI is doing in real-time
  • Execution Logs: Understand the AI’s decision-making process
  • Timing: Most tasks complete in under a minute (3-minute maximum)

Tips for Success

  • Start Simple: Begin with basic interactions and build complexity
  • Learn from Logs: Review execution logs to understand what worked and what didn’t
  • Break It Down: For very complex tasks, use multiple AI Action steps

Writing Effective Prompts

The key to reliable AI Action is clear, specific prompts. When something doesn’t work, use the PRECISE framework to diagnose and improve.

The PRECISE Framework

Think of these as diagnostic levers — not every prompt needs all seven, but knowing which to adjust makes troubleshooting easier.
LeverWhen to AdjustExample
PositionAgent clicks wrong element”click create button in the test plans page
RouteWrong interaction typeright click the folder to open context menu”
EffectDoesn’t wait for UI change”click submit to open the modal
ConstraintsDoes too much or repeats”scroll down ONCE only, not more than that
IntervalFails on loading states”wait for spinner to disappear, takes 3-5 sec
SpecificsEnters wrong data”enter ‘John Doe’ in the name field”
End StateMoves on without confirmingverify the entry appears in the table”
For a deep dive into writing effective prompts with complete examples and patterns, see our Prompting 101 Guide.

Quick Examples

Instead of: “Click login” Try: “Click the login button in the header to open the login modal” Instead of: “Fill form” Try: “Fill the registration form with email ‘[email protected]’ and password ‘Test123!’, then click submit to show the success message” Instead of: “Scroll down” Try: “Scroll down the page ONCE only, not more than that”

Using Dynamic Values

You can use expressions in your prompts to make them dynamic and reusable:
  • Random Data: "Register with email {{random.email()}} and password {{random.string({length: 8})}}"
  • Environment Variables: "Navigate to {{env.BASE_URL}}/dashboard"
  • Previous Step Data: "Update phone number to {{steps.userPhone}}"

Complete Examples

E-commerce Flow

Add the first product to cart, click the cart icon in the header to open the cart drawer,
verify the item appears, then click checkout to navigate to the checkout page.

Admin Task

Click on user management in the sidebar to open the users list, find the user with
email '[email protected]', click the 3-dot menu on that row, and select 'Make Admin'
from the dropdown.

Form with Dynamic Fields

Fill the contact form: enter 'John Doe' in the name field, enter '[email protected]'
in the email field and press Enter to validate it, wait for the phone field to appear
(takes 1-2 sec), then enter '555-0123' in the phone field.

Full CRUD Flow

Click the '+' button on the environments page to open the creation modal.
Enter '{{random.firstName()}}' into the name field and click submit.
Verify the environment appears in the sidebar list.
Wait 2-3 seconds for the UI to update.
Right click on the newly created entry and click 'Delete' from the context menu.
Confirm the deletion and verify it's removed from the sidebar.

Working with Other Steps

AI Action combines well with other step types:
ScenarioRecommended Approach
Before AI ActionUse Navigate to reach the right page
After AI ActionUse Verify Value to confirm success
Between AI ActionsUse Wait for Element for timing control
Capture DataUse Extract Value to save information

Troubleshooting

Using Execution Logs

AI Action provides detailed logs to help you understand what the AI did and debug issues. In the Editor (Real-time Logs): When running tests in the editor, you can see real-time execution logs as the AI performs actions.
AI real-time logs in editor
In Run History (Post-execution Logs): After a test run completes (both editor and headless runs), detailed logs are available in the run history.
AI Action logs

Task Not Completing

  • Be More Specific: Add details about exactly what you’re trying to accomplish
  • Simplify: Break complex tasks into smaller, focused steps
  • Check Context: Make sure you’re describing the current page state accurately

Unexpected Behavior

  • Review Logs: The execution logs show exactly what the AI did and why
  • Refine Description: Make your instructions clearer or more specific
  • Add Constraints: Use phrases like “ONCE only” or “don’t click submit”

Performance Issues

  • Simplify Tasks: Complex operations might need multiple steps
  • Add Waits: Use Wait for Element steps between AI Actions if needed
  • Monitor Timeouts: Very complex tasks may need the full 3-minute execution time