Move to the element and click (without releasing) in the middle of the given element.

For more info on working with DOM elements in Nightwatch, refer to the Finding & interacting with DOM Elements guide page.

Usage

                    browser.element(selector).clickAndHold()
                

Example

export default {
  demoTest(browser: NightwatchAPI): void {
    browser.element('button.submit-form').clickAndHold();
  },
  async demoTestAsync(browser: NightwatchAPI): Promise<void> {
    await browser.element('button.submit-form').clickAndHold();
  }
}

Returns

Type description
ScopedWebElement

See also