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');
?
click(protractor. Button. RIGHT). perform(); await browser.
As we click up and down the button on the mouse to perform an activity. Similarly, the mouse up and mouse down methods in Protractor are used to click up and down the primary mouse button.
I would have done like this:
browser.actions().mouseMove(el.find()).perform();
browser.actions().click(protractor.Button.RIGHT).perform();
Based on what I saw in actionsequence.js and Protractor rightClick issue #280
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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With