I am trying to select "Back" after performing a Right Click. I can get the Right-Click menu. I am getting an error when I try to select "Back". Here is the code:
browser.driver.findElement(By.linkText("Back")).click();
I am using Chrome browser on MAC-OS.
Here is the error:
Message: NoSuchElementError: no such element (Session info: chrome=43.0.2357.130) (Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Mac OS X 10.10.3 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 23 milliseconds
You can use following jQuery code to detect Right Mouse Click
And that you can call following code to perform back button action (or go to lastly visited page)
Hope this is what you are looking for.