When you train a mobile or browser test, mabl collects information about the elements that you interact with to ensure your tests target the correct element during execution. If the target element is very similar to other elements on the page, you can add Configure Find to specify which element attributes are the most important and the time that mabl should wait for a matching element (up to 15 minutes).
Configuring find steps is particularly useful when:
- It may take an extended period of time for your application to reach the correct state
- You would like mabl to search for an element based on a specific attribute and then continue with the test as soon as that attribute is found
- You would like the test to fail if an attribute is not present on the page within the specified time frame
Read on to learn how to…
Adding Configure Find
You can add Configure Find to any mobile or browser test step that interacts with an element:
- Click on More actions (...) .
- Click on Configure Find.
Creating a configured find step
- In the Configure Find menu, select the attributes that you would like mabl to target. The attributes available are based on the element that has been selected. Ancestor elements are called "containers" because they contain the element used in the step.
Selecting attributes for the step
- After selecting attributes, set a timeout. The timeout indicates the minimum amount of time mabl should wait.
- Browser tests only: Select how mabl should proceed if the timeout is met without finding an element matching ALL the selected Configure Find attributes:
- Disable auto-heal (default action): If mabl does not find an element that matches all of the Configure Find attributes, the step fails.
- Auto-heal: If mabl does not find an element that matches all of the Configure Find attributes, mabl expands the search parameters and selects the next best element candidate. See our guide on auto-heal for more information.
Specifying the timeout and action if the element is not found
Resilient Configure Find steps
During test execution, mabl only considers elements that match ALL the selected Configure Find values before either failing (if auto-heal is disabled) or attempting to auto-heal.
To ensure that the step is not over-constrained, only select the most important attributes.
Creating data-driven find steps
You can also use Configure Find to create dynamic find steps that target elements using variable or parameter values.
In the Configure Find menu, click on the edit option for the attribute you want to edit:
Editing attributes in configured find steps
Edit the attribute to look for a specific variable or flow parameter using mabl variable syntax.
For example, to target a button with an innerText that matches the value of the variable buttonName
, update the Configure Find value to {{@buttonName}}
.
Using mabl variable syntax in Configure Find