I am trying to use Selenium Webdriver to right click on a page, and navigate the context menu. This script should open a right click menu, and navigate Up 2 options, then select with the Return key...
driver.Navigate().GoToUrl("http://www.google.com");
//Google search bar
IWebElement tb = driver.FindElement(By.Id("lst-ib"));
Actions action = new Actions(driver);
//Right Clicks outside of the search bar.
action.MoveToElement(tb, -5, -5).ContextClick().Perform();
action.SendKeys(Keys.Up).SendKeys(Keys.Up).SendKeys(Keys.Return).Perform();
The right click executes as it should (outside of the search bar), but after that, there is no evidence of the Up arrow being pressed, and nothing is selected with the Return key. The menu options should highlight as they scroll through.
I am using the latest version of ChromeDriver 2.30, and Chrome 59.0.3071.109