When attempting to mouse hover on a menu with multiple sub-menus, I encountered an issue where the suggested actions caused other menus to overlap and hide the intended element. Below is the recommended code snippet for hovering over the desired element:
Actions action = new Actions(Driver);
Actions hoverclick = action.MoveToElement(HomePageMaps.MegaMenuDevelopAndGrowAsManager());
hoverclick.Build().Perform();
I am seeking advice on a JavaScript solution specifically for mouse hovering in Selenium using C# [Visual Studio IDE].
I have also experimented with the following JavaScript code for hovering, however, it did not result in actual hovering but only focused on the element:
IJavaScriptExecutor exe = (IJavaScriptExecutor)Driver;
exe.ExecuteScript("arguments[0].fireEvent('onmouseover');", xpath of the element to be hovered());