Overview

Unlike traditional automation steps that require explicit action definitions, the AI Instruction step can understand and execute a sequence of actions from a single natural language instruction. The AI agent reasons through the prompt and determines the required steps to accomplish the goal.

Key Benefits

  • Automatic Step Resolution: AI determines and executes all necessary sub-steps
  • Reduced Test Maintenance: Less brittle than explicit step-by-step instructions
  • Handles Dynamic Content: Adapts to changing UI elements and layouts

Usage Examples

Login Flow

"instruction": "Log in with the following credentials: [email protected] and test123"

The AI agent will automatically:

  1. Locate the username field
  2. Enter “[email protected]
  3. Locate the password field
  4. Enter “test123”
  5. Find and click the login button

Complex Form Filling

"instruction": "Fill out the registration form with: Name: John Smith, Email: [email protected], Phone: 555-0123, Address: 123 Main St, and select 'Premium' as the subscription plan"
 "instruction": "Go to the product catalog, filter for blue t-shirts under $30, and add the first item to the cart"

Best Practices

  1. Be Specific: While the AI is powerful, clear and specific instructions yield the best results
// Good
"instruction": "Click the 'Subscribe' button in the footer and enter email: [email protected]"
   
// Less Optimal
"instruction": "Subscribe to the newsletter"
  1. Include Expected Values: When dealing with forms or inputs, explicitly state the values
// Good
"instruction": "Search for product 'XYZ-123' and select the first result"
   
// Less Optimal
"instruction": "Search for a product"
  1. Use Natural Language: Write instructions as you would explain them to a person
// Good
"instruction": "Add 3 items of the red shirt to the cart and proceed to checkout"
   
// Less Optimal
"instruction": "click+add,quantity=3,goto:checkout"

Limitations

While the AI Instruction step is powerful, be aware of these limitations:

  • Complex conditional logic might require multiple instruction steps
  • Very specific UI interactions might be better served by explicit steps
  • Performance may vary based on the complexity of the instruction

Tips for Success

  1. Start with simple instructions and gradually increase complexity
  2. Monitor execution to ensure desired outcomes
  3. Keep instructions focused on a specific goal or task