I'm writing a test(using selenium) to verify that after a i right click on a particular part of our website, it should show the standard context menu (copy, past, reload, saveAs etc) and not our created context menu.
I need to find a way to check the items on the context menu after the right click, any ideas?
Heres where i am so far...
private IWebDriver driver = null;
private WebDriverWait wait = null;
private Actions action;
[TestInitialize()]
public void Initialize()
{
driver = new ChromeDriver();
driver.Navigate().GoToUrl("http://localhost/testwebportal");
wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));
action= new Actions(driver);
}
[TestMethod]
public void Right_click_brochure_while_zoomed_in_ID_8_2()
{
// click brochure
var clickFirstProduct = driver.FindElement(By.CssSelector("div.MetaSearchBrochureTile:nth-child(1) > div:nth-child(1) > img:nth-child(2)"));
clickFirstProduct.Click();
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(1500));
// zoom in
var brochurePage = driver.FindElement(By.CssSelector(".p1"));
brochurePage.Click();
action.ContextClick(brochurePage);
// code to check if context menu is not my created right click menu browser,
// by looking at the menu items after the right click.
action.Perform();
}
Ray