When your dev team marks elements with custom attributes like data-qaid, data-cy, or formcontrolname, mabl can now use those attributes to identify elements in your tests. By configuring custom test ID attributes for your web applications, mabl can adapt to the coding standards your team already uses to build your app.
If your app relies on custom test ID attributes, the benefits of configuring them in mabl include:
- Reducing reliance on Configure Find and CSS/XPath, so you can train more resilient finds from the start.
- Getting more out of Configure Find, which surfaces your custom attributes alongside mabl's built-in ones.
- Improving auto-heal outcomes, since the find model can anchor on attributes your dev team treats as stable.
- Improving outcomes from agentic test authoring, since the mabl agent uses your custom attributes as primary selectors when authoring new steps.
Try it out
To configure custom test attributes for your web app, go to Configuration > Applications and open the application you want to update.
Custom test ID attributes only apply to web applications.
In the Advanced section, enter attribute names in the Custom test ID attributes field. For example: data-qaid, data-cy, or data-automation-id. You can configure up to three attributes per application.
If your web app uses other attributes to uniquely identify elements, such as id, you may add those as well. Just make sure the attributes you add can reliably identify elements in your web app. Otherwise, they could end up complicating the find process.
How it works
When mabl captures a find for a step, whether through manual training in the Trainer, agentic test authoring, or retraining, it now checks for any custom test ID attributes you've configured for the application. If a configured attribute is present on the target element, mabl stores its value and treats it as a primary identifier when locating that element on subsequent runs.
Existing tests will not pick up the new configuration until their steps are retrained. The next time you train or retrain a step against an element that has a configured attribute, mabl captures it as part of the find model.
When you edit a find step, configured attributes appear under a new Custom IDs section at the top of the find details:
If no configured attribute is present on the element, or if the element cannot be found using the custom ID, mabl falls back to its standard find model, including built-in attributes like name, title, and innerText.