.click() Suggest edits
Since: 3.0.0Simulates a click event on the given DOM element.
The element is scrolled into view if it is not already pointer-interactable. See the WebDriver specification for element interactability.
For more info on working with DOM elements in Nightwatch, refer to the Finding & interacting with DOM Elements guide page.
Usage
browser.element(selector).click()
Example
export default {
demoTest(browser: NightwatchAPI): void {
browser.element('button.submit-form').click();
},
async demoTestAsync(browser: NightwatchAPI): Promise<void> {
await browser.element('button.submit-form').click();
}
}
Returns
Type | description |
---|---|
ScopedWebElement |