---
title: "type(text[, options]) | Grafana k6 documentation"
description: "Dispatches a `keydown`, `keypress` or`input`, and `keyup` events for each character in the text."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# type(text\[, options])

Dispatches a `keydown`, `keypress` or`input`, and `keyup` events for each character in the text. This is useful for simulating typing text into an input field.

Expand table

| Parameter     | Type   | Default | Description                                                          |
|---------------|--------|---------|----------------------------------------------------------------------|
| text          | string | `''`    | The text to type into the input field.                               |
| options       | object | `null`  | Optional settings.                                                   |
| options.delay | number | `0`     | Optional. Time to wait before typing each character in milliseconds. |

### Returns

Expand table

| Type            | Description                                                              |
|-----------------|--------------------------------------------------------------------------|
| `Promise<void>` | A Promise that fulfills when the text has been typed in the input field. |
