> 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/en/autify-university/foundation/creating-a-scenario/select-from-list-by-label.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Select a value from a list

## Step that selects a value from a list

When you record the action that selects a value from a list implemented with a `<select>` element, a ***\[Select ... From List]*** step is created.

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-0d257dfcd87b8843da2effe55694da388e5694a7%2Fen_select_from_list.png?alt=media)

{% hint style="info" %}
**Lists implemented with anything other than the `<select>` element**

When you record an action that selects a value from a list implemented with anything other than a `<select>` element, it will typically result in two clicks being recorded: a click that opens the options and another click that select an option.
{% endhint %}

### Search target

During test runs, Autify looks at the options within the list and searches for the value set in the "Label".

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-41b7d682bd29dd2b9d6b549b58e13d72a94eba08%2Fen-label-list.png?alt=media)

The search target is the value enclosed in the option tag (`<option>This string</option>`). Currently, Autify does not support options where the option tag doesn't enclose a value, for example `<option label="1" value="1"></option>`.

{% hint style="warning" %}
**Selections other than by label are not supported**

The \[Select ... From List] step currently does not support selection by any method other than complete label matching, such as:

* Selecting the Nth option.
  * [You can achieve this by combining the "JS Steps for Elements"](https://help.autify.com/nocode-web/en/tips-1/select-box-tips/select-the-nth-of-options.md)
* Selecting an option that contains '\~'.
* Selecting an option that starts with '\~'.
  {% endhint %}

### If the step is not recorded

Autify Recorder detects when a value has changed (such as when a selection has changed) and records steps accordingly. Therefore, if you re-select an already selected value, the \[Select ... From List] step will not be recorded.

To record the step, you can first select a different option, then re-select the desired value. Afterward, you can remove any unnecessary steps.

### If the value is not recorded

Since Autify does not currently support options where the option tag does not enclose a value, such as `<option label="1" value="1"></option>`, if you record the action that selects such an option, the value won't be recorded and "..." in \[Select ... From List] will be blank.

If you enter a value in the Scenario Edit page afterwards, Local Replay will work, but Autify not will be able to find the option during test execution, causing the test to fail.

{% hint style="warning" %}
**The difference between Local Replay and test execution**

Local Replay is a feature that helps when updating test scenarios, and its behavior may be different from test execution. This is one such difference. For more details, see [**Record here (Local replay) - 3. The difference between Local Replay and test execution**](https://help.autify.com/nocode-web/en/autify-university/foundation/creating-a-scenario/local-replay.md#the-difference-between-local-replay-and-test-execution)
{% endhint %}

### Add a locator

When adding a [locator](https://help.autify.com/nocode-web/en/autify-university/advanced/locator-feature/add-a-locator.md), be sure to specify the CSS selector/XPath of the `<select>` element you want to select, not the `<option>` element. If you specify a CSS selector/XPath of an element other than the `<select>` element, Local Replay and test execution will fail.

Please note that specifying the CSS selector/XPath of the option you wish to select in the locator does not result in the selection of that option.

## Lists that allow multiple selections

Lists with the "multiple" attribute allow you to select multiple options. If you perform an action that changes the selected option in a list that allows multiple selections, Autify creates two steps: \[Unselect ... From List] and \[Select ... From List].

If you select **1** and then select **2**, these steps will be recorded:

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-b3574ea5c738dc28399ad7389ce46edce61ba087%2Fen-select-multiple.png?alt=media)

If you select **1** and then select **2** while holding down Shift or Ctrl (cmd), the \[Unselect ... From List] step will not be created:

![](https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-427e3c839f3c001aba33bee11b535e0f169257d1%2Fen-select-multiple-shift.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/en/autify-university/foundation/creating-a-scenario/select-from-list-by-label.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.
