Skip to main content

What Makes AI Action Special

Think of AI Action as your intelligent assistant that can understand natural language and perform complex browser tasks that would normally require dozens of individual steps. Instead of manually clicking, typing, and waiting for elements, you just describe what you want to accomplish in plain English.

How to Access AI Action

The Easy Way: Natural Language

The simplest way to use AI Action is through natural language. Just type what you want to do in the command bar and click “Ask Agent”. The AI automatically creates an AI Action step with your description as the prompt. For example:
  • “Log into the admin panel and navigate to user management”
  • “Fill out the registration form with test data”
  • “Search for John Doe and click on his profile”

The Precise Way: Command Menu

You can also access AI Action through the command menu:
  1. Type ”/” in the command bar to open the step selector
  2. Search for “AI Action” (it’s in the “Interactions” category)
  3. Click to add it to your test
ai-action-command-menu.png Accessing AI Action through the command menu by typing ”/” and searching

Writing Effective Prompts

The key to getting great results is writing clear, descriptive prompts that tell the AI exactly what you want to accomplish.

Prompt Writing Guidelines for AI Action

Be Specific About Intentions:
  • “Verify the login flow works correctly”“Log into the application using test credentials, verify the dashboard loads, then log out”
  • “Check the search functionality”“Search for ‘laptop’ in the product catalog, verify at least 3 results appear, click on the first result and verify the product details page loads”
Include Context and Constraints:
  • “Update user profile”“Navigate to user settings, update the phone number to ‘+1-555-0123’, save changes, and verify the success message appears”
  • “Process order”“From the shopping cart with 2 items, proceed to checkout, fill in test billing information, complete payment, and verify order confirmation”
Specify Expected Outcomes:
  • “Test form submission”“Fill out the contact form with test data, submit it, and verify both the success message and email notification are sent”
Use Expressions for Dynamic Values: You can use expressions in your AI Action prompts to make them more dynamic and reusable:
  • Random Data: "Register a new user with email {{random.email()}} and password {{random.string({length: 8})}}"
  • Environment Variables: "Navigate to {{env.BASE_URL}}/dashboard and verify the user {{env.TEST_USER}} can access their profile"
  • Previous Step Data: "Update the user's phone number to {{steps.userPhone}} and verify the change is saved"
  • Dynamic URLs: "Search for products in {{steps.selectedCategory}} and add the first result to cart"

When AI Action Shines (And When It Doesn’t)

Perfect Scenarios for AI Action

Dynamic, Complex Interactions:
  • Forms that change based on what you’ve already filled in
  • Search features that need understanding of context or suggestions
  • Admin dashboards with interconnected sections and conditional logic
  • Multi-step wizards or onboarding flows where each step depends on the previous one
Human-Like Decision Making:
  • Choosing the right option from a list based on visible data
  • Reading and interpreting text, numbers, or visual information
  • Finding and clicking elements that might have moved or changed
  • Recovering gracefully when something unexpected happens on the page
Real-World Examples:
  • “Complete the checkout process with test payment information”
  • “Find and update the user’s profile with new contact details”
  • “Navigate through the settings menu and enable two-factor authentication”
ai-action-understanding-page.png

When to Stick with Traditional Steps

Keep it simple for:
  • Basic button clicks and link following (use Click instead)
  • Straightforward form filling (use Fill instead)
  • Simple navigation to known URLs (use Navigate instead)
  • Performance testing with repetitive actions
  • API testing for backend functionality

Crafting Better Prompts

The Art of Clear Instructions

Good prompts are like giving directions to a friend - specific, contextual, and focused on the outcome. Instead of: “Click login” Try: “Log into the admin panel using the credentials from environment variables” Instead of: “Fill form” Try: “Complete the user registration form with valid test data and verify the confirmation message”

Context Matters

Help the AI understand where you are and what you’re trying to achieve:
  • Current State: “From the dashboard…” or “After logging in…”
  • Clear Goal: “I want to…” or “I need to accomplish…”
  • Specific Details: “Look for the user named John Doe” or “Change the theme to dark mode”

Scenario-Specific Examples

E-commerce Flow:
"Add 3 different items to the cart, proceed to checkout, fill in test billing information, and complete the purchase"
Admin Task:
"Navigate to the user management section, find the user with email 'test@example.com', and update their role to 'admin'"
Content Management:
"Go to the articles section, find the draft titled 'Getting Started Guide', make an edit to fix the typo, and publish it"

Working with AI Action

Getting Started

Start with simple, focused tasks and gradually work up to more complex scenarios. The AI learns from each execution and gets better at understanding your specific application.

Watching the Magic Happen

  • 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, with a 3-minute maximum

Refining Your Approach

  • Start Small: Begin with basic interactions and build complexity
  • Learn from Results: See what works well and refine your prompts accordingly
  • Break It Down: For very complex tasks, consider multiple AI Action steps

Debugging Vague Prompts

When a prompt doesn’t work as expected, use the execution logs to understand the AI’s reasoning:
  1. Check the Logs: Review the detailed execution logs to see exactly what the AI did and why
  2. Identify Issues: Look for patterns where the AI misunderstood your intent or got stuck
  3. Refine Prompts: Make instructions more specific based on what you learn from the logs
  4. Iterate: Test refined prompts and continue improving based on results

Troubleshooting Common Issues

When Things Don’t Go As Planned

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: Specify exactly what you want to avoid or focus on
Performance Issues:
  • Simplify Tasks: Complex operations might need to be broken into 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
ai-action-logs.png

Testing Scenarios Where AI Action Excels

AI Action is particularly powerful for testing complex, dynamic workflows that traditional automation struggles with:

Multi-Step Conditional Testing

"Test the complete user onboarding flow: start registration, handle dynamic form fields that appear based on user type selection, complete email verification, and verify the welcome dashboard displays correctly"

Dynamic Content Validation

"Navigate to the product catalog, search for items in the 'Electronics' category, verify search results appear, click on a product with multiple variants, select different options and verify price updates, add to cart and verify the cart reflects the correct selections"

Complex Admin Panel Testing

"Access the admin dashboard, navigate to user management, find a user with 'pending' status, review their profile details, approve their account, and verify the status changes to 'active' with appropriate email notification"

Adaptive Form Testing

"Complete the insurance quote form: enter personal details, dynamically answer health questions that appear based on age and medical history, calculate premium, and verify the final quote matches expected pricing logic"

Working Alongside Other Steps

AI Action works great with other step types to create comprehensive tests:
  • Before AI Action: Use Navigate to get to the right page
  • After AI Action: Use Verify Value to check that the AI accomplished the task correctly
  • Between AI Actions: Use Wait for Element if one AI Action needs to complete before another starts
  • For Data Extraction: Use Extract Value to capture information that the AI found or created

The Bottom Line

AI Action transforms how you approach browser automation. Instead of spending hours scripting complex interactions, you can describe what you want to accomplish in plain language and let the AI handle the details. It’s particularly powerful for:
  • Dynamic Applications: Where elements and flows change based on user data or previous actions
  • Complex Workflows: Multi-step processes that require decision making and adaptation
  • Human-Like Testing: Scenarios that benefit from understanding context and making intelligent choices
Start with simple tasks and gradually explore more complex scenarios. The AI gets better with each interaction and learns to understand your specific application better over time.
I