Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Automate dynamic workflows with AI interactions

Use natural language to perform dynamic actions and validations on your website.

Low Code Automation offers AI Interactions, a feature that lets you generate test steps using natural language prompts based on your website’s current state. Unlike traditional fixed steps that may break when your website changes, AI-generated steps dynamically adapt to the context during each test run.

For example, if you’re testing a flight booking flow and need to select today’s date, a fixed date selector might fail when the test is run on a different day. With AI Interactions, you can simply prompt: β€œSelect today’s date for departure”, and the correct date will be automatically selected every time the test runs.

The AI interactions feature is currently in Alpha. For more details, contact us.

Example Use Cases:

  • Enter any available date in the next month for departure and return dates: AI analyses the page, finds the next month, and selects any available date accordingly.
  • Ensure terms and conditions are mentioned in English: The AI verifies that the terms are in English, based on the current page.
  • Add to cart the first product from the search results having price greater than $20: The AI analyses the search results, identifies products priced over $20, and adds the first one to the cart.
  • Validate search results are sorted in ascending order of price: The AI verifies the current page to confirm that the terms and conditions are written in English.

Generate dynamic test steps with AI interactions

The AI interactions feature is currently not supported for mobile browser tests.

  1. In the Low Code Automation recorder, go to the step where you want to generate an interaction, then click AI interactions.
    Click AI interactions
  2. Enter your prompt in the AI interactions text box. You can use natural language to describe any action or validation you want to perform. For example: β€œSelect today’s date for departure” or β€œVerify that the terms and conditions are in English.” AI Interaction text box
  3. Click ✨Perform to execute the action or validation. While the step is being performed, you can view the AI thoughts to understand what the AI is doing. If a test step fails due to the prompt, review these thoughts to refine your prompt accordingly. View AI thoughts
  4. Click Save recording when you are done.

Use the thumbs up or thumbs down buttons to share your feedback. Your input helps us improve and refine the AI prompts for better performance.

AI interaction examples

The following are sample use cases that demonstrate how to use AI Interaction.

Supported actions for AI interactions

AI interactions support the following types of user actions:

  • Click
  • Text input
  • Hover
  • Scroll up
  • Scroll down

Import variables in AI interactions

You can import variables directly into your AI step prompts to reuse values and make your tests more dynamic. This allows you to reference global variables, test dataset values, or other test variables in your prompt.

Imported variables can be used in your prompt to dynamically generate actions or validations based on the variable’s value. This is especially useful for:

  • Running the same test with different data sets
  • Referencing values extracted from previous steps
  • Making your AI interactions more flexible and maintainable

To use a variable in AI Interactions:

  1. In the AI interactions prompt box, type @ to view available variables. Alternatively, click the + icon below the prompt box and choose the variable you want to import. Type @ to view available variables
  2. Select from global variables, test dataset values, or other test variables.
  3. Reference a variable in your prompt. For example:
    Open the Wikipedia page for @Topic and verify the first paragraph contains @expectedText
    This prompt uses the values of the Topic and expectedText variables during test execution, allowing you to validate different Wikipedia pages and their content dynamically. Screenshot showing how to add variables in a sample prompt

Currently, Secrets are not supported within AI interaction prompts.

For more details about creating and using variables and global variables, see Variables and Global variables.

Edit AI steps

You can edit the step by modifying the prompt even after execution. Click the Edit icon next to the AI interaction to update the prompt and regenerate the step. Edit AI prompts

The prompt window appears. You can edit the existing prompt or enter a new one.

Replay AI steps

The image shows a validation and action step executed through AI interaction. Each time the step runs during replay, it uses AI based on the provided prompt. You can expand the View AI thoughts button to see how the AI analyzed and decided how to execute the step.

Screenshot of execution of AI interactions

Points to remember

  • AI Interactions is currently in Alpha and supports a maximum of 5 AI-generated steps per test.
  • Use the recorder to create static stepsβ€”ideal for parts of your application that don’t change frequently.
  • For dynamic workflows, use AI Interactions for actions and validations that adapt based on the application’s current state.
  • AI Interactions work best for targeted, context-aware actions or validations. Use very specific prompts to generate more precise and accurate steps.
  • Avoid writing prompts that require scanning across multiple pages or achieving large objectives. Instead, break tasks into smaller, focused actions or validations for better accuracy and reliability.
  • Write concise and clear prompts and provide relevant context.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle