---
title: "wait"
sidebarTitle: "wait"
description: "Pause the execution of the script for a specified duration."
icon: "clock"
"mode": "wide"
---

import Replay from "/snippets/tests/wait-replay.mdx";
import Example from "/snippets/tests/wait-yaml.mdx";

<Replay />
<Example />

## Description

The `wait` command pauses the execution of the script for a specified number of milliseconds before continuing. This is useful for adding delays between commands or waiting for certain conditions to stabilize.

## Arguments

| Argument  | Type     | Description                           |
| --------- | -------- | ------------------------------------- |
| `timeout` | `number` | The duration in milliseconds to wait. |

## Example usage

```yaml
command: wait
timeout: 5000
```

## Protips

- Use the `wait` command to handle timing issues, such as waiting for animations to complete or elements to load.
- Avoid using excessively long timeouts to keep tests efficient.

## Gotchas

- Overusing the `wait` command can slow down test execution. Use it only when necessary.
- Ensure the timeout value is appropriate for the scenario to avoid unnecessary delays.

## Notes

- The `wait` command is ideal for introducing controlled pauses in your test scripts.
- Whenever you are waiting for something to load, use the [wait-for-text](/commands/wait-for-text) or [wait-for-image](/commands/wait-for-image) commands instead to make the test more efficient.
