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 })
NameTypeDescription
selectorselectorA selector to search for element to clear. If there are multiple elements satisfying the selector, the first will be cleared.
optionsObjectClick options. Default: {}.
options.waitForNavigationbooleanWait for navigation after clear. Default navigation timeout is 30 seconds, to override pass { navigationTimeout: 10000 } in options parameter. Default: true.
options.waitForStartnumberwait for navigation to start. Accepts time in milliseconds. Default: 100.
options.navigationTimeoutnumberNavigation timeout value in milliseconds for navigation after click. Default: 30000.
options.forcebooleanSet to true to perform action on hidden/disabled elements. Default: false.
options.waitForEventsArrayEvents available to wait for [‘DOMContentLoaded’, ‘loadEventFired’, ‘networkAlmostIdle’, ‘networkIdle’, ‘firstPaint’, ‘firstContentfulPaint’, ‘firstMeaningfulPaint’, ‘targetNavigated’] Default: [].
TypeDescription
Promise<void>