> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# awaitListener

> Block until a previously registered listener captures a request.

Resolves to `{ request, response }` once a request matching the listener
completes. Pair with `saveAs` to read the captured payload from `env`.

## Parameters

| Parameter | Type      | Required | Description                                                           |
| --------- | --------- | -------- | --------------------------------------------------------------------- |
| `key`     | `string`  | Yes      | Listener key set on `registerRequestListener`.                        |
| `timeout` | `number`  | No       | Maximum time in milliseconds to wait.                                 |
| `saveAs`  | `string`  | No       | Name of the variable to write this step's return value to.            |
| `retries` | `number`  | No       | Number of times to retry the step on failure before failing the test. |
| `skipped` | `boolean` | No       | Skip this step at execution time.                                     |

## Shorthand

Listener key as a single string.

```yaml theme={null}
- awaitListener: response
```

## Examples

```yaml theme={null}
- awaitListener:
    key: response
    saveAs: RESPONSE
```

## Related

* [Network requests](/guides/page-interactions/network-requests)
* [Test format](/core-concepts/test-format)
