> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-mobile/en/troubleshooting/troubleshooting-swipe-to-element/swipe-to-element-fail-to-find-an-image-match-for-the-element.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

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

## What is this error?

In a Swipe to Element step, Autify locates the target element based on the appearance of area around the element that you selected during recording. If the appearance of the target element changes significantly or the detection pattern lacks distinctive features, Autify may fail to locate it, resulting in this error.

## How to handle this error

To handle this error, it is necessary to distinguish whether Autify missed the element or it didn't swipe enough times.

In a Swipe to Element step, Autify swipes several times until the target element appears, taking a screenshot at each swipe. You can view these screenshots by using the arrows to the right of the test result screenshot.

![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-ae8e729e5e0fe0b2962e4c768ce65e4e3d897a9b%2Fen_swipe_to_element_test_result.gif?alt=media)

Please check the screenshots to see if the target element was missed or not.

### If the target element was missed

If the target element was missed, use Quick Element Update to update the element. Using Quick Element Update allows you to easily update the target element's information without re-recording.

To use Quick Element Update, open the Test Result page, click the Swipe to Element step, and then click the ***\[Update element]*** button at the bottom right of the modal.

![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-57a62d0d7920df9ee13828c5a56df4535afe3b75%2Fen_qeu_button_swipe_to_element.png?alt=media)

There are three ways to update elements using Quick Element Update:

* [Image recognition](#image-recognition)
* [XPath](#xpath)
* [Accessibility ID](#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](https://help.autify.com/nocode-mobile/en/using-autify-nocode-mobile/test-execution/quick-element-update.md).

### If Autify didn't swipe enough times

If Autify didn't swipe enough times and the target element is not visible in any of the screenshots, you can increase the "Max swipes" (up to a maximum of 20) so that the target element appears in the screenshot.

![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-07a02461203159c4fdf73250d96b197c9ab91087%2Fen-max-swipes.png?alt=media)

Alternatively, you can re-record the step to make the swipe gesture is bigger, so that Autify reaches the element with fewer swipes. With Swipe to Element, the **first** swipe you make during recording will be repeated as many times as you set in *Max swipes*. By making this first swipe as large as possible, you can reduce the number of swipes needed to reach the element.

## Image recognition <a href="#image-recognition" id="image-recognition"></a>

Use the arrows on the right side of the screenshot to navigate to the screenshot that contains the target element, and click the ***\[Update element]*** button. Then, adjust the detection pattern and click ***\[Update element]***.

![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-35dca7af4d47fcecb313ed64cd5f490d96bd52de%2Fen_qeu_swipe_to_element.gif?alt=media)

When updating the element, the element and its surrounding areas should have a distinctive appearance. For more information, see [Image recognition tips](https://help.autify.com/nocode-mobile/en/troubleshooting/tips/tips-to-stabilize-element-selection-image-recognition.md).

## XPath <a href="#xpath" id="xpath"></a>

If Autify cannot reliably locate the correct element using image recognition, you can use an XPath to specify which element to target. After clicking ***\[Update element]***, change Locator Type to ***\[Page Source]***.

![](https://1041389054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj0BSsfTevAGpY0hwBHT7%2Fuploads%2Fgit-blob-27f383ac3f5494e42690d379e3f1834b23f2824c%2Fen_qeu_xpath_swipe_to_element.gif?alt=media)

There are two ways to specify the XPath:

* Use 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 that don't directly relate 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](https://help.autify.com/nocode-mobile/en/troubleshooting/tips/tips-to-stabilize-element-selection-xpath-and-accessibility-id.md).

## Accessibility ID <a href="#accessibility-id" id="accessibility-id"></a>

If the Swipe to Element step is still unreliable despite using image recognition and XPath, we recommend using Accessibility ID.

{% hint style="warning" %}
**If there is no Accessibility ID**

If the element doesn't have an Accessibility ID, you need to add it in your application code.
{% endhint %}

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](https://help.autify.com/nocode-mobile/en/troubleshooting/tips/tips-to-stabilize-element-selection-xpath-and-accessibility-id.md).

## If you are still having trouble...

Please contact our Customer Support team. We will help resolve the issue.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-mobile/en/troubleshooting/troubleshooting-swipe-to-element/swipe-to-element-fail-to-find-an-image-match-for-the-element.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
