Conditional Waits Between Steps in AI Recorder
Use the Conditional Wait step in the AI Recorder to pause test execution until a specific condition on an element is satisfied. This is useful when the wait time depends on dynamic UI behavior such as a button becoming enabled or a checkbox being checked, rather than a fixed delay.
Unlike the Sleep step, which waits for a set time, Conditional Wait ensures smoother execution by continuing immediately once the condition is met or after the timeout expires, whichever comes first.
This step does not fail the test if the condition is not met within the timeout. It simply waits until the timeout completes and then moves to the next step.
Add a Conditional Wait Step
Open the AI Recorder and begin editing or recording a scenario.
Click the + (Add a step type) button and select Add a conditional wait step from the list.
Click to select the element on which the condition will be applied.
Choose one of the available conditions:
- Checked / Unchecked
- Visible / Hidden
- Enabled / Disabled
- Editable
Note
The list of available conditions may vary based on the selected element. For example, checkboxes support Checked / Unchecked, while input fields may support Editable or Enabled / Disabled. The Recorder dynamically adjusts the condition options according to the element's properties.
Enter the timeout duration in milliseconds (default is 1000 ms). You can increase it if the condition typically takes longer to become true. Click Save to insert the step.
The step appears in the scenario list and pauses test execution until the specified condition on the element is met or the timeout duration is reached.
Behavior During Test Execution
If the condition is met within the timeout, the test proceeds to the next step immediately.
If the condition is not met within the timeout, the test waits for the full duration, shows a warning, and then moves to the next step without failing the scenario.
How It Appears
In the Features page, the Conditional Wait step is displayed as:
Then Wait "X" seconds for element to be [condition] This label reflects the selected element, the specified condition, and the timeout duration set during recording.
After the scenario is executed, the Conditional Wait step appears in the Reports page with the same label and a status indicator:
- If the condition is met within the timeout, the step is marked green.
- If the condition is not met within the timeout, the step shows a warning icon and is styled differently to indicate that the wait timed out but it does not fail the scenario.