Protractor - does anybody know how to click on element with RIGHT MOUSE BUTTON?

后端 未结 3 1849
渐次进展
渐次进展 2021-02-06 07:29

I know that protractor click on element by default with left mouse button. How to do it to click with RIGHT MOUSE BUTTON ?

el.click(\'RIGHT\'); ?

3条回答
  •  庸人自扰
    2021-02-06 07:41

    The accepted solution for this question isn't the best way to go about this. Browser actions' .click() method accepts an optional arg for clicking the right button. A better solution, from the webdriverJs api is:

    browser.actions()
        .click($('.myElm'), protractor.Button.RIGHT)
        .perform();
    

提交回复
热议问题