Skip to content

Instantly share code, notes, and snippets.

@PierrickP
Created August 8, 2014 16:16
Show Gist options
  • Save PierrickP/095cd73dad49210b5767 to your computer and use it in GitHub Desktop.
Save PierrickP/095cd73dad49210b5767 to your computer and use it in GitHub Desktop.
browser.actions().mouseMove(element(by.css('#myElement'))).perform();
browser.actions().click(protractor.Button.RIGHT).perform();
@IrfanAhamad
Copy link

I used the above code but getting error "Failed: Cannot read property 'RIGHT' of undefined" on mouse right click.
var el = element.all(by.xpath("//*[text()[normalize-space() = '" + "Active" + "']]")).get(1);
el.click();
browser.sleep(3000);
browser.actions().mouseMove(el).perform();
browser.actions().click(protractor.Button.RIGHT).perform();

@qualityshepherd
Copy link

From the webdriverJs api, you can right click an element thusly:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment