How do I resolve an error 'Unable to find an image match for the element selected during recording' ?
  • 14 May 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

How do I resolve an error 'Unable to find an image match for the element selected during recording' ?

  • Dark
    Light

Article summary

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.

en-quick-element-update.png

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".

en-quick-element-update-xpath.png

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 there is no 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.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.