Appearance
I.clear()
Clears any existing value from a text input field.
This is the same as using I.fill(element, "").
INFO
This command uses the same targeting mechanism as the I.fill() command.
Usage
js
I.clear(element: string)Parameters
| Parameter | Type | Description |
|---|---|---|
element | string | Element to clear — by text, CSS selector, or XPath. |
Example
js
I.clear("Email") // using visible text
I.clear(".email-input") // using css
I.clear("input[@type='email']") // using xpathThis command clears the value of the "Email" input field.