Taiko
Documentation

Home / API Reference

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'}))

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.waitForNavigation boolean

Wait for navigation after clear. Default navigation timeout is 30 seconds, to override pass { navigationTimeout: 10000 } in options parameter.

Default value
true

options.waitForStart number

wait for navigation to start. Accepts time in milliseconds.

Default value
100

options.navigationTimeout number

Navigation timeout value in milliseconds for navigation after click.

Default value
30000

options.waitForEvents

Events available to wait for ['DOMContentLoaded', 'loadEventFired', 'networkAlmostIdle', 'networkIdle', 'firstPaint', 'firstContentfulPaint', 'firstMeaningfulPaint']

Default value
['firstMeaningfulPaint']

Returns

Promise