> For the complete documentation index, see [llms.txt](https://docs.drizz.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drizz.dev/writing-tests/tap/type.md).

# Type

`Type` enters text into a field. The field does not need a separate tap first, and it does not need clearing.

|                   |                                                            |
| ----------------- | ---------------------------------------------------------- |
| **Platforms**     | Android · iOS                                              |
| **Focus**         | Automatic — no separate tap needed                         |
| **Existing text** | Replaced, not appended                                     |
| **Keyboard**      | Dismissed automatically after typing                       |
| **Watch out**     | Without a field name, the text can land in the wrong input |

## Prerequisites

* A connected device or emulator
* An open test file
* The screen containing the field reachable by the steps above the `Type`

## Copy this

```
OPEN_APP com.shopease.android
Wait Until 5 Seconds

Tap on Log in
Type qa@example.com in the email field
Type 9000000000 in the mobile number field
Tap on Continue
Wait Until 3 Seconds

Type 123456 in the OTP field
Tap on Verify
Wait Until 5 Seconds
Validate that the home screen is visible
```

## Write a type step

1. Confirm the screen has finished loading — add a `Wait` or a `Validate` above the `Type`.
2. Write `Type <value> in <field name>`, using the field's visible label.
3. Add a section, a position, or an adjacent value when the label appears more than once.
4. Add `Wait Until <n> Seconds` before the next tap when that tap targets an element the keyboard can cover.
5. Run the test and confirm the report shows the value in the intended field.

## Always name the field

The field name is what stops the text landing in the wrong input. On any screen with more than one field, name it.

```
Type qa@example.com in username field
Type password123 in password field
Type John into the name field
Type 9000000000 into the phone number field
```

| Field has                        | Write                                                                             |
| -------------------------------- | --------------------------------------------------------------------------------- |
| A unique visible label           | `Type John into the name field`                                                   |
| A label repeated in two sections | `Type John in personal details section` · `Type John in shipping details section` |
| No label                         | `Type 123 in the first input field` · `Type 456 in the second input field`        |
| An adjacent value only           | `Type 42 next to "Age"` · `Type 500 near "Quantity"`                              |

## Describing a value instead of supplying one

For fields that must be unique per run:

```
Type any random 10 digit number starting with 48 in Contact Number field
Type a random 8 character alphanumeric string in Reference Number field
```

## Variables

Any variable works inside a `Type`:

```
Type {{phone}} in the mobile number field
Type {{otp}} in the OTP field
```

See [Which variable do I use?](/writing-tests/which-variable.md).

## Automatic behavior

| Behavior               | Detail                                                                                                                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Focus**              | Drizz focuses the field. A separate tap first is allowed and helps on crowded screens, but is not required                                                                            |
| **Existing text**      | Replaced in full. Auto-populated and previously entered values are overwritten. Drizz does not append and does not edit inline — read the value with `Store` first to keep part of it |
| **Keyboard submit**    | `Tap on the search icon on the keyboard` works as a normal tap                                                                                                                        |
| **Keyboard dismissal** | On by default. An open keyboard covers the next element, and the tap that follows reports as undoable                                                                                 |

Keyboard dismissal is disabled for a small number of apps where dismissing broke the flow. The setting is not visible or editable in the desktop app.

{% hint style="warning" %}
If a tap immediately after a `Type` keeps failing as undoable, the keyboard is the first thing to suspect. Ask your Drizz contact whether keyboard handling is enabled for your app.
{% endhint %}

## OTP fields

| OTP input                   | Commands                                                                         |
| --------------------------- | -------------------------------------------------------------------------------- |
| One consolidated box        | `Type 123456 in the OTP field`                                                   |
| Split boxes, one digit each | <p>One command per box<br>Eg.<br>Type 1 in first box<br>Type 2 in second box</p> |

## Common mistakes

<table data-search="false"><thead><tr><th>What you wrote</th><th>What happens</th></tr></thead><tbody><tr><td><code>Type qa@example.com</code> with no field named</td><td>Focus lands wherever the app left it. On a two-field screen this is a coin flip</td></tr><tr><td><code>Type John in the name field</code> on a form with <code>First name</code> and <code>Last name</code></td><td>Ambiguous. Name the field exactly, or add the section</td></tr><tr><td>A <code>Type</code> immediately after the screen appears</td><td>Typing during a transition or while the field is still loading drops characters. Add a <code>Wait</code> or a <code>Validate</code> first</td></tr><tr><td><code>Tap on the field</code> then <code>Type</code> then <code>Tap on Submit</code>, with no wait</td><td>The extra tap is harmless, but the keyboard may still be closing when the <code>Submit</code> tap fires</td></tr><tr><td>Expecting <code>Type 5</code> to append to an existing <code>10</code></td><td>You get <code>5</code>. Existing text is replaced. <code>Store</code> the value first if you need to build on it</td></tr><tr><td><code>Type 123456 in the OTP field</code> on a six-box OTP input</td><td>Only the first box receives input. Write one command per box</td></tr><tr><td>Typing a value the app rejects, with no <code>Validate</code> after</td><td>The run continues on an error screen and fails somewhere unrelated</td></tr></tbody></table>

## Next

* [Tap](/writing-tests/tap.md) — the command that follows a `Type`
* [Validate](/writing-tests/tap/validate.md) — check what you typed landed
* [Which variable do I use?](/writing-tests/which-variable.md) — typing values from a dataset

***

*Last updated: 6 August 2026*
