puppeteer/docs/api/puppeteer.locator.fill.md
dependabot[bot] 93e9acc410
chore(deps-dev): Bump the dev-dependencies group with 3 updates (#12101)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikolay Vitkov <nvitkov@chromium.org>
2024-03-20 15:03:14 +00:00

75 lines
954 B
Markdown

---
sidebar_label: Locator.fill
---
# Locator.fill() method
Fills out the input identified by the locator using the provided value. The type of the input is determined at runtime and the appropriate fill-out method is chosen based on the type. contenteditable, selector, inputs are supported.
#### Signature:
```typescript
class Locator {
fill<ElementType extends Element>(
this: Locator<ElementType>,
value: string,
options?: Readonly<ActionOptions>
): Promise<void>;
}
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
this
</td><td>
[Locator](./puppeteer.locator.md)&lt;ElementType&gt;
</td><td>
</td></tr>
<tr><td>
value
</td><td>
string
</td><td>
</td></tr>
<tr><td>
options
</td><td>
Readonly&lt;[ActionOptions](./puppeteer.actionoptions.md)&gt;
</td><td>
_(Optional)_
</td></tr>
</tbody></table>
**Returns:**
Promise&lt;void&gt;