Search code examples
c#visual-studiowatin

Watin Runscript No Wait


In Watin, as we 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.


Solution

  • 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);