Generating Test Automation using Yaan AI
Yaan AI is an advanced DevAssure feature designed to significantly accelerate the creation of test automation scripts.
By leveraging artificial intelligence, Yaan AI can interpret the human-readable "Detailed Steps" and an application URL to generate ready-to-use test automation. This greatly reduces the manual effort and technical expertise traditionally required for automation development, allowing teams to achieve faster and more efficient testing cycles.
To generate scripts using Yaan AI, follow these simple steps:
-
Navigate and Input Steps: Go to the Detailed Steps section in the test case. Provide sequential instructions on how a user would interact with the application. These steps describe the actions to be performed and the expected outcomes.
-
Provide Application URL: Specify the URL of the application under test. This allows Yaan AI to analyze the web page and identify relevant elements.
-
Initiate Generation: Click the Yaan AI button to generate the full automation script.
Workflow Example
Let's look at an example of how Yaan AI processes the test steps input to generate a complete script.
- Detailed Steps: Enter the step-by-step instructions in natural language. Example Input
- Login into the Saucedemo application with username `standard_user` and password `secret_sauce`
- Choose an item and add to cart
- Proceed to checkout and complete purchase

-
Application URL: You will be prompted to provide the application URL.
-
Test Script Generation: The Yaan AI agent processes the detailed steps and then generates the corresponding comprehensive test automation script, including elements like locators, actions, and assertions, even if those specific actions weren't explicitly stated in the original test steps.
Example Output -Generated Script
1. Open URL https://www.saucedemo.com/v1/
2. Input value "standard_user" in web > SwagLabs > user_name
3. Input value "secret_sauce" in web > Login_Elevate > password
4. Click on web > SwagLabs > login_button
5. Click on web > SwagLabs > ADD_TO_CART
6. Click on web > SwagLabs > _1 (Cart icon)
7. Click on web > SwagLabs > CHECKOUT
8. Input value "John" in web > SwagLabs > first_name
9. Input value "Doe" in web > SwagLabs > last_name
10. Input value "12345" in web > SwagLabs > postal_code
11. Click on web > SwagLabs > login_button
Intelligent Step Inference:
A key differentiator of Yaan AI is its ability to infer and include missing steps in the test automation. Even if the provided "Test Steps" are high-level or generic, Yaan AI intelligently analyzes the application's user interface and common user flows to fill in the necessary granular actions.
For instance, a generic step like "login into saucedemo application" will be expanded by Yaan AI into specific actions such as opening the URL, inputting username, inputting password, and clicking the login button.

Best Practices for Using Yaan AI
To get the most out of Yaan AI, consider the following best practices for writing the detailed steps:
- Be Specific (when possible): While Yaan AI can infer, being more specific with the instructions (e.g., "Click on the 'Exams' link in the navigation bar" instead of "Go to the exam page") can lead to even more precise automation.
- Use Actionable Verbs: Start the steps with verbs that describe a direct action, such as "Click," "Type," "Select," "Verify," etc.
- Specify Elements (when known): When interacting with elements, providing enough detail for the AI to identify them (e.g., "Click the 'Submit' button" or "Type 'John Doe' into the 'Name' field") is helpful.
- Break Down Complex User Flows: For very complex interactions, breaking them down into logical, sequential steps will assist the AI in understanding the overall flow, even if it adds the granular actions itself.
- Focus on User Intent: Describe the user's journey and goals clearly. Yaan AI excels at understanding the overall user intent and then translating that into specific actions.