开发者

Mouse right button in WatiN

开发者 https://www.devze.com 2022-12-20 20:30 出处:网络
How to use Right Mouse button in WatiN? I tried the following code but it didn\'t work.. Div div1 = pzDev.Div(\"AppExplorer\");

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

精彩评论

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

关注公众号