> ## 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.

# type

> Type text into an input, optionally clearing and submitting.

Types the given text. Without `into`, types into whatever currently has focus.
`clear` controls whether existing input is cleared first.

## Parameters

| Parameter    | Type                                         | Required | Description                                                                                     |
| ------------ | -------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- |
| `text`       | `string`                                     | Yes      | The text to type.                                                                               |
| `into`       | `string`                                     | No       | Description of the input to focus before typing.                                                |
| `css`        | `string`                                     | No       | CSS selector for the target. Use instead of the description key.                                |
| `coords`     | `string \| { x, y }`                         | No       | Absolute viewport coordinates. Either an `x, y` string (e.g. `120, 40`) or a `{ x, y }` object. |
| `x`          | `number \| string`                           | No       | X coordinate. Must be provided together with `y`.                                               |
| `y`          | `number \| string`                           | No       | Y coordinate. Must be provided together with `x`.                                               |
| `force`      | `boolean`                                    | No       | Force the action even when the element is not actionable.                                       |
| `iframe`     | `string`                                     | No       | URL or URL pattern of the iframe that contains the target element.                              |
| `offset`     | `string \| { x, y }`                         | No       | Pixel offset from the resolved target. Either an `x, y` string or a `{ x, y }` object.          |
| `pressEnter` | `boolean`                                    | No       | Press Enter after typing.                                                                       |
| `clear`      | `"inputs" \| "always" \| "never" \| boolean` | No       | Clear existing input before typing. `inputs` only clears `<input>`/`<textarea>` elements.       |
| `delay`      | `number`                                     | No       | Milliseconds between keystrokes.                                                                |
| `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

Text as a single string. Targets the focused element.

```yaml theme={null}
- type: hello world
```

## Examples

```yaml theme={null}
- type:
    text: local@jeffan.ca
    into: email input field with placeholder for your email address
    clear: never
```

```yaml theme={null}
- type:
    text: "{{ env.PASSWORD }}"
    into: password textbox
    clear: inputs
```

```yaml theme={null}
- type:
    text: "{{ env.NAME }}"
    pressEnter: true
    clear: inputs
```

```yaml theme={null}
- type:
    text: student
    coords: 1129, 616
    clear: inputs
```

## Related

* [Finding elements](/core-concepts/finding-elements)
* [Test format](/core-concepts/test-format)
