Search This Blog

March 23, 2016

Selenium and C#: How to do mouse hover action in Selenium?

Today I wanted to verify the texts. The interesting part is that if I don’t do mouse hover action, Selenium WebDriver can’t return the texts. It returns empty string.

If I use the following code (Action-MoveToElement-Perform ) to do mouse hover action on the account menu in the site, I can verify the texts easily.  

Actions actions = new Actions(driver);
actions.MoveToElement(elementName);
actions.Perform();

Thread.Sleep(1000);

No comments: