I have a menu like structure, where hovering on a menu item opens a sub menu after some delay. I have problems to web test this menu using deterministic methods (= no usage of Thread.Sleep) with Selenium.
- To hover on an element I need to use Selenium's
Actions
builder class (MoveToElement
) - To wait for the sub menu to be visible I need to use a
WebDriverWait.Until(d => subMenuWebElement.Displayed)
.
How to combine these two approaches? I haven't found a way to add the WebDriverWait.Until call to the Actions object. What is the recommended way to solve my problem?
I have found various other threads on SOF, however, they either solve only one of the two bullet points above, or have no working answers (e.g. Selenium WebDriver MoveToElement - hidden element, hover and toggleClass).
Hope somebody can help :-)