- Print
- DarkLight
How do I resolve an error 'Unable to find an image match for the element selected during recording' ?
What is this error?
In a Tap step, Autify locates the target element based on the appearance of area around the element that you tapped during recording. If the appearance of the target element changes significantly, Autify may fail to locate it, resulting in this error. Depending on where you tapped during recording, Autify may not be able to locate it even if its appearance has not changed.
How to handle this error
To resolve this error, use Quick Element Update. This feature allows you to easily update the target element's information without re-recording.
To use Quick Element Update, open the test result page, click a Tap step, and then click the "Update element" button at the bottom right of the modal.
There are three ways to update elements using "Quick Element Update":
- Image recognition
- XPath
- Accessibility ID
In general, we recommend that you try image recognition first, followed by XPath, and then Accessibility ID. For details on each, see Quick Element Update.
Image recognition
In the Test Results page, select the Tap step that needs to be fixed and then click the "Update element" button. Next, select the position you want to tap on the screenshot and click the "Update selected element" button.
When updating the tap position, the element and its surrounding areas should have a distinctive appearance. For more information, see Image recognition tips.
XPath
If Autify cannot reliably tap the correct element using image recognition, you can use an XPath to specify which element to tap. After clicking the "Update element" button, click "Update element via XPath".
There are two ways to specify the XPath:
- Use the auto-generated XPath
- Manually adjust the auto-generated XPath
Use the auto-generated XPath
Autify generates the XPath automatically. However, since it references the entire tree, changes not directly related to the target element, or even minor changes such as reordering elements of the same type, can cause the element to not be found.
Manually adjust the auto-generated XPath
Auto-generated XPaths can be manually adjusted. You can improve reliability by adding information that'll help Autify locate the correct element, and deleting unnecessary information.
For more information, see XPath tips.
Accessibility ID
If the Tap step is still unreliable despite using image recognition and XPath, we recommend using Accessibility ID.
If the element doesn't have an Accessibility ID, you need to add it in your application code.
If the element has a "name" attribute on iOS or a "content-desc" attribute on Android, you can ensure that the target element is selected by setting these attributes in the Accessibility ID.
For more information, see Accessibility ID tips.
If you are still having trouble...
Please contact our Customer Support team. We will help resolve the issue.