Writing a locator by hand means inspecting the page, choosing an attribute that will still be there next build, and checking that it matches one element rather than twelve. Starting with mabl Desktop App version 2.68.2, you can hand that work to mabl. The Locator section of the custom find editor has a Pick an element to generate button: select it, click the element you want the step to target, and mabl writes a locator into the field.
How it works
- In the mabl Trainer, create or edit a custom find step.
- Next to Locator, select Pick an element to generate.
- Click the element on the page that the step should target.
- mabl writes a recommended locator into the Locator field, and the match preview updates so you can see how many elements it matches.
Edit the result like any other locator, or pick a different element to generate a new one. Each pick asks for a fresh recommendation for the element you clicked rather than refining the locator already in the field, so picking the same element again gives mabl another attempt at it. A new pick also clears any visual fallback description on the step, since that description described the element you picked before. If mabl cannot produce a locator for the element, the form tells you why.