Simulates a context-click(right 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).rightClick()
                

Example

export default {
  demoTest(browser: NightwatchAPI): void {
    browser.element('#main ul li a.first').rightClick();
  },

  async demoTestAsync(browser: NightwatchAPI): Promise<void> {
    await browser.element('#main ul li a.first').rightClick();
  }
}

Returns

Type description
ScopedWebElement

See also