> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/test-steps/runner/stop-when-element-is-displayed.md). Agents can also search and read this documentation through its [MCP server](https://docs.does.qa/~gitbook/mcp).

# Stop When Element Is Displayed

Stop when a specific element is displayed.

Stop When Element Is Displayed ends the remaining steps in the Test Case when the [Element](https://docs.does.qa/elements/creating-elements.md) is shown. Use it as a conditional exit when later steps only apply if that UI never appeared.

See [Element states](https://docs.does.qa/test-step-options/element-states.md) for how Displayed is evaluated.

![Stop when element is displayed Test Step](https://static.does.qa/assets/nodes/runner_stop_elementDisplayed.png)

## When to use it

* End the Flow early once a success banner or confirmation panel appears.
* Skip cleanup steps when an error message is already shown.
* Pair with [Stop When Element Not Displayed](https://docs.does.qa/test-steps/runner/stop-when-element-not-displayed.md) on another branch of the same journey.

## Configure

### Basics

| Field       | What to set                                                                |
| ----------- | -------------------------------------------------------------------------- |
| **Element** | The [Element](https://docs.does.qa/elements/creating-elements.md) to watch |

### Advanced

| Field                                 | What to set                                                              |
| ------------------------------------- | ------------------------------------------------------------------------ |
| **Status on fail**                    | [Failed Status](https://docs.does.qa/test-step-options/failed-status.md) |
| **When should screenshots be taken?** | `Always` or `On Failures` (default)                                      |

## Related

* [Stop When Element Not Displayed](https://docs.does.qa/test-steps/runner/stop-when-element-not-displayed.md)
* [Stop When Value](https://docs.does.qa/test-steps/runner/stop-when-value.md)
* [Element states](https://docs.does.qa/test-step-options/element-states.md)
* [Runner](https://docs.does.qa/test-steps/runner.md)

**Tags:** `runner`, `stop`, `elementDisplayed`, `state`
