clear
Clears the value of given selector. If no selector is given clears the current active element.
Examples
await clear()
await clear(textBox({placeholder:'Email'}))
await clear(textBox({ placeholder: 'Email' }), { waitForNavigation: true, force: true })
Parameters
-
selector -
A selector to search for element to clear. If there are multiple elements satisfying the selector, the first will be cleared.
-
options -
Click options.
-
options.waitForNavigationboolean -
Wait for navigation after clear. Default navigation timeout is 30 seconds, to override pass
{ navigationTimeout: 10000 }inoptionsparameter.- Default value
-
true
-
options.waitForStartnumber -
wait for navigation to start. Accepts time in milliseconds.
- Default value
-
100
-
options.navigationTimeoutnumber -
Navigation timeout value in milliseconds for navigation after click.
- Default value
-
30000
-
options.forceboolean -
Set to true to perform action on hidden/disabled elements.
- Default value
-
false
-
options.waitForEventsArray<string> -
Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint', 'targetNavigated']
- Default value
-
[]
Returns
Promise<void>