How to MouseOver in your C# tests

I have created a fairly simple to use C# method to perform a MouseOver operation, all you need to do is to specify the web element to MouseOver.

Add the following using statement first:
[code]using OpenQA.Selenium.Interactions;[/code]

Then create the following method:
public static void MouseOver(IWebElement theElement)
Actions builder = new Actions(driver);

Its fairly easy to use and I have a sample of how to call it below:
IWebElement theMenuLink = driver.FindElement(By.Id(“menu”));

Leave a Reply

Your email address will not be published. Required fields are marked *