warningUse locator-based locator.click([options]) instead.
This method clicks on an element matching a selector.
Parameter | Type | Default | Description |
---|---|---|---|
selector | string | '' | A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. |
options | object | null |
Returns
Type | Description |
---|---|
Promise<void> | An asynchronous operation that doesn't return a value. |
Example
Click action without navigation
When a click action results in a page navigation, remember to work with page.waitForNavigation() to properly handle the asynchronous operation.
Click action with navigation