开发者

Watin Runscript No Wait

开发者 https://www.devze.com 2023-03-01 05:00 出处:网络
In Watin, as w开发者_Python百科e have for button.Click() and button.ClickNoWait() methods. How can we have this for ie.Runscript(\"Script\").

In Watin, as w开发者_Python百科e have for button.Click() and button.ClickNoWait() methods. How can we have this for ie.Runscript("Script").

In the script run actually a modal popup is opened, because NoWait or equivalent is not available I cannot handle the modal popup :(

Can anyone please suggest me.


One way you can get around this is to wrap your script code with JavaScript's settimeout() function and then run that via WatiN.

string timed = string.Format("setTimeout(\"{0}\", 500);", script);

Document.RunScript(timed);                        
0

精彩评论

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