Lucas
Lucas

Reputation: 3491

how to test hovering in WatiN

I am trying to test hovering over an anchor that has a drop down. I am using this syntax:

Browser _currentBrowser = new IE();

_currentBrowser.Link(Find.ById("navigation-id")).MouseEnter();

The navigation-id exists, and ideally a display:none ul would change to display:block, but I feel that this MouseEnter() doesn't actually depict a hover effect. What should I be doing to represent a hover action?

Upvotes: 3

Views: 1205

Answers (1)

Phil Lambert
Phil Lambert

Reputation: 1047

try this...

Browser _currentBrowser = new IE();

Link myLink = _currentBrowser.Link(Find.ById("navigation-id"));
myLink.FireEvent("mouseover");
myLink.FireEvent("mousemove");

HTH!

Upvotes: 3

Related Questions