Selenium WebDriver in Visual Studio With C#. I've create a driver Object, which I'm using an instance of.
I'm trying to Access the top menu on this site: http://store.demoqa.com/
The second menu element, "Product Category", has a submenu. I'm trying to emulate a mouse-over of the "Product Category" element, then select and click the first element in the list (Accessories).
This is what I've got so far, pieced together by several searches here and elsewhere. It works up the point of clicking on the menu item ("Accessories"). I see that the top element is selected, and that the menu item is "selected" because it slightly indents when hovering the mouse over it. However, from there I cannot seem to Click() it.
"menu-item-33" is the top menu item, Product Category. "menu-item-34" is the sub menu item Accessories.
Actions action = new Actions(FFDriver.Instance);
IWebElement we = FFDriver.Instance.FindElement(By.Id("menu-item-33"));
action.MoveToElement(we).MoveToElement(FFDriver.Instance.FindElement(By.Id("menu-item-34"))).Click().Build().Perform();
It moves to the correct item, but the Click() function doesn't seem to work, since the page isn't changed.
Pardon me if this is too little information, but I've tried to keep it narrowed down to the code that seems to be the struggle.