> 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-web/faq/faq-create-scenario/faq-recording/unable-to-select-desired-assertion.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# レコーディング時に使用したいアサーションが出てこないのはなぜですか？

レコーディング時に、要素をクリックしてもアサーションが記録されない、もしくは希望する種類のアサーションが選択肢に表示されない場合、以下のような原因が考えられます。

## 近くにある別の要素を選択してしまっている

まずは、アサーションを行いたい要素を正しく選択できているか確認してください。 選択した要素によって、利用できるアサーションの種類は異なります。 例えば、ボタンに対して有効 (クリック可能) か無効 (クリック不可) かのアサーションを行いたいとします。 この場合、選択の対象は `<button>` 要素である必要があります。 近くにある別の要素 (親や兄弟要素など) を選択してしまっていると、「対象が有効/無効であることを確認する」アサーションが表示されないことがあります。

* [ページ内の要素に対するアサーション](https://help.autify.com/nocode-web/autify-university/advanced/assertions-1/assertion-elements-on-the-page.md)

## 対象の要素にCSSプロパティ `pointer-events: none` が適用されている

希望する要素に対してアサーションが記録できない場合、その要素に `pointer-events: none` という CSS プロパティが適用されている可能性があります。この CSS プロパティが適用されている場合、イベントの発火が無効化されてしまうために、レコーダーが要素に対する操作を記録できなくなります。 以下に、この場合のワークアラウンドを 2 つ紹介します。

### 1. `pointer-events: none` を削除する

ウェブサイトを変更してこのスタイルを取り除くか、 Chrome DevTools から、一時的にこのプロパティを無効化します。 レコーダーが要素を認識できるようになるためこちらの方法を推奨しますが、難しい場合は 2 つ目の方法をお試しください。

### 2. `pointer-events: none` が適用されていない時に作成したアサーションステップを使用する

例としてボタンの有効 / 無効を検証したい場合のワークアラウンドを紹介します。 この方法は以下の前提を満たしている必要があります。

* ボタン有効時は対象の要素にフォーカスでき、「対象が有効であることを確認する」ステップが作成できる
* ボタン無効時は `pointer-events: none` の影響でフォーカスできず、「対象が無効であることを確認する」アサーションも表示されない

前提を満たしている場合は以下の方法でボタンが無効であることを検証できます！

1. シナリオにある「対象が有効であることを確認する」ステップをコピーする (まだステップがない場合はレコーディングしてステップを作成してください)
2. コピーした「対象が有効であることを確認する」ステップのアクションの選択肢を開き、**対象が無効であることを確認する** を選択し保存する

   ![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-ef920c968bd16b517ad784d6daa3f1d35055a7a4%2Fchange-action.png?alt=media)


---

# 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-web/faq/faq-create-scenario/faq-recording/unable-to-select-desired-assertion.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.
