开发者

Mouse right button in WatiN

How to use Right Mouse button in WatiN?

I tried the following code but it didn't work..

Div div1 = pzDev.Div("AppExplorer");
Span sp1 = div1.Span(Find.ById(new Regex("cl_")));
NameValueCollection eventProperties = new NameValueCollection();
eventProperties.Add("button", "2"); 
sp1.FireEvent("onmouseover",eventProperties);
Thread.Sleep(1000); 
sp1.Fir开发者_运维百科eEvent("onmousedown",eventProperties); 
sp1.FireEvent("onmouseup",eventProperties);

Can anyone suggest the right approach?


This should work only if you have javascript event "onmouseover" or "onmousedown",etc. associated to your specified elements.

It will not made a right button, just simulate the call to a javascript event, like a right mouse click would have done.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜