Context Clicks
The Context Click feature lets you automate a click on an element based on nearby reference text. Instead of relying only on fixed selectors, the engineer can define a relationship between a reference and a target element.
This makes test steps more flexible and reusable. For example, instead of creating separate steps for each product, file, or task, the engineer can parameterize the reference text and use the same step for multiple scenarios.
Why Use Context Clicks?
Automated tests often involve repeating the same action in different contexts. A context click allows the AI Test Engineer to:
- Reuse one command across multiple data sets.
- Easily switch which element is clicked by changing only the reference text.
- Reduce maintenance by avoiding multiple duplicate steps.
Example in practice
Imagine an e-commerce website where every product has its own Add to Cart button. Instead of recording a separate click for each product, you can record just one context click. The only thing that changes between runs is the product name defined as a parameter.
Examples:
Click on the cart button for a specific "<product>". The "<product>" value can be changed to decide which product is added to the cart.

Adding a Context Click Step
To add a context click during recording:
In the AI Recorder, click the Add Step button to open the custom steps menu.

Select Add a context click command.

In the context selection box:
- Choose the reference text (this becomes the parameter).
- Click the element to interact with, relative to that reference.
In the GIF below, we're selecting a product name as context and it's add to cart button as the related element.

Click Save to add the step. You can see the generated step and its realted parameter in the AI Recorder.

Run Tests With Different Context Values
You can modify the context parameter value to click different elements in each run. For example, add multiple Example rows with different product names to dynamically click corresponding cart buttons.

Making the 2nd Click Dynamic
Sometimes both the reference text and the clickable target change across test cases. This is helpful when both the context and action vary. For instance, an engineer might want to click “Edit” for one user and “Delete” for another.
After choosing the reference and the element, check This is a dynamic value.

These values now appear in the Examples section, where they can be modified for each test run.


