Click here to Skip to main content
14,775,044 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

I am writing scripts in c#,

I have written the code for menu hover and sub menu click just as below,

Actions actions = new Actions(driver);
IWebElement menuHoverLink = driver.FindElement("id", "idofelement");

actions.MoveToElement(menuHoverLink).Build().Perform();

By submenucss = By.CssSelector("cssselectorofelement");

WebDriverWait wait1 = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
wait1.Until(ExpectedConditions.ElementExists(submenucss));
IWebElement submenu = driver.FindElement(submenucss);
submenu.Click();

But it is not working for all browsers.

I want the code that works in all or atleast (chrome,firefox,IE).

If anybody have the idea then please share your knowledge.

Regards,
Kedar Borkar.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900