> 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/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).

# 「レコーディング時に選択した要素に似た要素を見つけられませんでした」というエラーが出ます。どうすれば良いですか？

## このエラーは何ですか？

「要素までスワイプ」ステップは、レコーディング時に記録された要素周辺の見た目をもとに要素を探し、その要素が表示されるまでスワイプをします。そのため、対象要素の見た目が大幅に変化した場合や指定された検出パターンが特徴に乏しい場合に要素が見つけられなくなることがあり、その結果このエラーが発生します。

## 対応方法

このエラーに対応するには、要素の見逃しがあったのか、スワイプ回数が足りなかったのかを見分ける必要があります。

「要素までスワイプ」ステップは、対象の要素に到達するまでに何度かスワイプを繰り返し、スワイプごとにスクリーンショットを取得します。テスト結果スクリーンショットの右側にある矢印を操作することで、これらのスクリーンショットが確認可能です。

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

この機能でスクリーンショットを確認し、要素の見逃しがあったのかを確認しましょう。

### 要素の見逃しがあった場合

もし見逃しがあった場合は、「クイック要素更新」を使用し、要素のアップデートを行います。クイック要素更新を使うことで、対象要素の情報を再レコーディングなしで簡単に更新することが可能です。

クイック要素更新はテスト結果画面を開き、「要素までスワイプ」ステップをクリックし、表示されたモーダルの右下にある **要素を更新する** をクリックすることで使用できます。

![](https://1076629499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fngfbmyfc37v4emfzEMM7%2Fuploads%2Fgit-blob-23620ff9beefb5736095e97d3f3f87af4205f9ed%2Fja_qeu_button_swipe_to_element.png?alt=media)

クイック要素更新には以下3つの方法があります。それぞれの詳しい説明については[クイック要素更新](https://help.autify.com/nocode-mobile/using-autify-nocode-mobile/test-execution/quick-element-update.md)をご覧ください。

* [画像認識](#image-recognition)
* [XPath](#xpath)
* [Accessibility ID](#accessibility-id)

基本的には画像認識→XPath→Accessibility IDの順で試すことをお勧めします。

### スワイプ回数が足りなかった場合

スワイプ回数が足りずに対象の要素がスクリーンショットに写っていない場合は、最大スワイプ回数（最大20回まで）を増やすことで、対象要素がスクリーンショットに映るように調整が可能です。

![](https://1076629499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fngfbmyfc37v4emfzEMM7%2Fuploads%2Fgit-blob-30e84cda89af65fd7ee068072f097a6b8c3c23ee%2Fja-max-swipes.png?alt=media)

また、 少ないスワイプ回数で要素に到達できるよう、より大きいスワイプ操作でステップをレコーディングし直す方法もあります。「要素までスワイプ」はレコーディング時に **最初に** 行ったスワイプの量を最大スワイプ回数分実施するため、最初のスワイプをできるだけ大きくすることで、少ないスワイプ回数で要素に到達できるように調整することが可能です。

## 画像認識 <a href="#image-recognition" id="image-recognition"></a>

スクリーンショットの右側にある矢印を操作し、対象要素が表示されているスクリーンショットまで移動し、**要素を更新する** をクリックします。 その後、検出パターンを調整し、要素の更新をクリックします。

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

要素の更新の際は、要素やその周辺の見た目が特徴的になるようにする必要があります。気をつけるべき点については、[Tips - 画像認識](https://help.autify.com/nocode-mobile/troubleshooting/tips/tips-to-stabilize-element-selection-image-recognition.md)をご覧ください。

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

画像認識で安定しない場合は、XPathによる要素の指定も可能です。**要素を更新する** をクリックした後に、ロケータタイプを「Page Source」に変更します。

![](https://1076629499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fngfbmyfc37v4emfzEMM7%2Fuploads%2Fgit-blob-188e2569ed806b83466ae971e6e549ae0450e004%2Fja_qeu_xpath_swipe_to_element.gif?alt=media)

XPathには以下2つの指定方法があります。

* 自動生成
* 手動による調整

### 自動生成

AutifyがXPathを自動で生成してくれる一方で、ツリー全体を参照したXPathのため、対象要素と直接関係ない変更や、同じ種類の要素で順番が入れ替わるといった軽微な変更も影響し、要素が見つからなくなることがあります。

### 手動による調整

自動生成されたXPathを基に、手動でXPathを調整できます。手がかりとなる情報を追加したり、余分な情報を削除したりすることで安定性を向上させることができます。

XPathについてさらに知りたい場合は、[Tips - XPath](https://help.autify.com/nocode-mobile/troubleshooting/tips/tips-to-stabilize-element-selection-xpath-and-accessibility-id.md)をご覧ください。

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

もし画像認識とXPathどちらの方法でも安定的に要素が選択できない場合は、Accessibility IDの設定をお勧めします。

{% hint style="warning" %}
**Accessibility IDを持っていない場合**

対象要素がAccessibility IDを持っていない場合は、アプリケーションのコードでAccessibility IDを設定する必要があります。
{% endhint %}

iOSでは"name"属性、 Androidでは"content-desc"属性が要素に設定されている場合、Accessibility IDにこれらの属性の値を設定することで対象の要素が選択できます。

Accessibility IDについてさらに知りたい場合は、[Tips - Accessibility ID](https://help.autify.com/nocode-mobile/troubleshooting/tips/tips-to-stabilize-element-selection-xpath-and-accessibility-id.md)をご覧ください。

## それでも問題が解決しない場合...

いつでもカスタマーサポートチームにご連絡ください。問題を解決するお手伝いをいたします。


---

# 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/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.
