I'm doing automated tests of a web application in Java/Serenity.
There is a menue with submenues in the app. It's a javascript menu which opens submenues onmouseover. I need to open submenues of any level via Serenity. I'm doing it using the following code:
public void hoverElement(WebElementFacade element) {
Actions builder = new Actions(getDriver());
Actions hoverOverLocationSelector = builder.moveToElement(element);
hoverOverLocationSelector.perform();
}
It works very well in Firefox, but not in Chrome.
In Chrome, I have to call the hoverElement() function two or three times in a row to make it work. And this is not good.
Does anyone have ideas how to make it work without calling the function two or three times?
Thanks in advance.