> 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-assertion/can-i-validate-the-options-in-the-pull-down.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# プルダウンメニューの選択肢を検証することはできますか？

プルダウンメニューの選択肢に対して以下のような検証をしたいと思ったことはありませんか？

* プルダウンメニューの選択肢の内容を検証したい
* プルダウンメニューの中に特定の選択肢が存在(する / しない)ことを検証したい

Autifyでは以下のアサーションを使用することでプルダウンメニューの検証を行うことが可能です！

* 対象のテキストが〇〇であることを確認する
* 対象のテキストが〇〇を(含む / 含まない)ことを確認する

早速、プルダウンメニューの選択肢の検証をレコーディングしてみましょう。

レコーディング時の注意点として、プルダウンメニューの `select` 要素にフォーカスすると、「対象のテキストが〇〇であることを確認する」と「対象のテキストが〇〇を(含む / 含まない)ことを確認する」アサーションが選択肢に表示されません。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-4b67af26d143082b25f56c73ec024e729afffac8%2Fvalidate-pull-down-menu-focus-select-ja.png?alt=media)

表示させるには、 `div` 要素や `p` 要素などの、 `select` 要素を囲む親要素にフォーカスする必要があります。 親要素にフォーカスすると、「対象のテキストが〇〇であることを確認する」と「対象のテキストが〇〇を(含む / 含まない)ことを確認する」が選択肢に表示されます。 **対象のテキストが〇〇であることを確認する** を選択してみましょう。 すると、値にプルダウンメニューの選択肢が表示されました。この状態で **追加** をクリックしましょう。 これでプルダウンメニューの選択肢の内容を検証することができるようになりました。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-e88458fc48bda56664fe3546ae3997628a981d96%2Fvalidate-pull-down-menu-focus-div-ja.png?alt=media)

最後に、プルダウンメニューの中に特定の選択肢が存在 **しない** ことを実際にテストを実行して検証してみましょう。 ここでは確認のため、存在する選択肢を「対象がテキストが〇〇を含まないことを確認する」の値に設定して追加してみます。実際にテストが失敗するか見てみましょう。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-1314eccd2704daa591dfc01a2bf891039b6920c6%2Fvalidate-pull-down-not-exist-ja.png?alt=media)

テストを実行してみると、プルダウンメニューの中に指定した選択肢が存在するので期待通り失敗しています！

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-6168451ebc830bd64f6088a55a01846e4736f655%2Fvalidate-pull-down-fail-test-ja.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-assertion/can-i-validate-the-options-in-the-pull-down.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.
