Skip to content

clear()

Clears the value of given selector. If no selector is given clears the current active element.

await clear()
await clear(textBox({placeholder:'Email'}))
await clear(textBox({ placeholder: 'Email' }), { waitForNavigation: true, force: true })
Name Type Description
selector selector A selector to search for element to clear. If there are multiple elements satisfying the selector, the first will be cleared.
options Object Click options. Default: {}.
options.waitForNavigation boolean Wait for navigation after clear. Default navigation timeout is 30 seconds, to override pass { navigationTimeout: 10000 } in options parameter. Default: true.
options.waitForStart number wait for navigation to start. Accepts time in milliseconds. Default: 100.
options.navigationTimeout number Navigation timeout value in milliseconds for navigation after click. Default: 30000.
options.force boolean Set to true to perform action on hidden/disabled elements. Default: false.
options.waitForEvents Array Events available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: [].
Type Description
Promise<void>