I am currently working with Selenium WebDriver in C# and facing an issue with a RadMenu. My goal is to hover over the menu so that it expands a sub menu, where I can find a specific webelement to click. I have tried using JavaScript for this purpose, but unfortunately, it does not expand the menu as expected. Are there any specific JavaScript commands that I can use to achieve this? Here's what I have attempted so far:
IJavaScriptExecutor js = ts.getDriver() as IJavaScriptExecutor;
js.ExecuteScript("arguments[0].style.display='block'",leftPane_Customer);
js.ExecuteScript("arguments[0].click()", leftPane_Customer);
js.ExecuteScript("arguments[0].scrollIntoView(true);",leftPane_Customer);
Although the .click() function highlights the first menu, I am unable to expand the submenu. Can someone provide a solution (including suitable JavaScript syntax) to help me expand the submenu successfully?
Thank you.