WatiN.Core.IE component giving Timeout while Internet Explorer busy error while opening a URL

Ankush Roy picture Ankush Roy · Sep 21, 2010 · Viewed 12.3k times · Source

I am using WATin IE component for browsing a specific website On StartBrowsing button click event I am initializing the object of WatiN.Core.IE and passing the website URL for opening the website as shown in the code snippet below :-

WatiN.Core.IE ie;  

private void btnStartBrowsing_Click(object sender, EventArgs e)
{          
  ie = new IE(URLs.mainURL);
}

Sometimes or rather i should say 5/10 times I am getting this error :- "Timeout while Internet Explorer busy"

How to get around this problem??

Answer

alonp picture alonp · Oct 4, 2010

It might be a race condition try to increase the watin timeouts before you initialize the ie object.

Like this:

   Settings.AttachToBrowserTimeOut = 240;
   Settings.WaitUntilExistsTimeOut = 240;
   Settings.WaitForCompleteTimeOut = 240;