Adding wait and wait until steps

📘

Important information about using wait steps

All find actions in mabl, including assertions and clicks, will automatically wait up to 30 seconds for the targeted element to appear. There is generally no need to add an additional wait step before an assertion or another find action, unless the element will take more than 30 seconds to appear in your app, or if the element comes into existence without being fully realized. In the latter case, a wait step before the assertion may be necessary as mabl will evaluate as soon as it detects that the target element exists.

Adding wait steps to a test

With the mabl Trainer open, take the following steps:

  1. Select the Add step option (purple plus sign) at the bottom of the Trainer. A new screen in the Trainer will appear with various features.
  2. Click the "Wait" button. Two options - "wait" and "wait until" - will appear.
  1. Select "wait"
  2. Enter the desired number of seconds into the text box provided.
  1. Click "OK" to finish. The window will return to the main Trainer page, with the new wait step appearing in the "Steps" box.

📘

Maximum wait time for a wait step is 900 seconds (15 minutes)

Adding wait until steps to a test

"Wait until" steps tell mabl to wait up to 15 minutes for a specific element to be present, allowing you to ensure that your application is in the right state before executing subsequent steps. Wait until steps are less static than wait steps and less rigid than using CSS and XPath queries to find an element. Utilize these steps to specify the timeout and the attributes that mabl should wait for before attempting to auto-heal.

You can add a "wait until" step by taking the following steps in the mabl Trainer:

  1. Select the Add step option (purple plus sign) at the bottom of the Trainer. A new screen in the Trainer will appear with various features.
  2. Click the "Wait" button. Two options - "wait" and "wait until" - will appear.
  3. Select "wait until"
  4. Click on the "Select" cursor button. A blue overlay will appear on the screen with the message "Select an element."
  1. Choose the target element on the browser page.
  2. Select the attributes that mabl should search for. The value for an attribute can be modified by selecting the pencil icon. Once you have selected the target attributes, click "Next".
  1. Configure the maximum wait time.
  2. If desired, disable auto-heal by selecting the "Fail this step" button.
  3. Click "OK" once finished. The Trainer window will return to the main page with the new wait until step appearing in the "Steps" box.

The selected attributes can be seen by hovering over "View criteria". The step can also be edited by clicking on the "View criteria" badge.

📘

Ancestor Elements

In addition to selecting attributes of the target element, you can also specify attributes of the element that the target is contained in. This container may also be referred to as an ancestor element.

Configurable finds

Existing steps can also be modified to become wait until steps. These steps can become a wait until step by using the "Configure find" option in the "More actions" menu. After configuring the values for the target element, you can set a maximum time to wait for the target element to appear.


Did this page help you?