0

How setup Wait timeout? I have page that renders dom, and next - page send several ajax requests. Dotnetbrowser think that page finished loading, but network requests still raises.

BrowserView browser= new WinFormsBrowserView(BrowserFactory.Create());    
ManualResetEvent waitEvent = new ManualResetEvent(false);
browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e)
{
    // Wait until main document of the web page is loaded completely.
    if (e.IsMainFrame)
    {
        waitEvent.Set();
    }
};
browser.LoadURL("http://www.example.com");
waitEvent.WaitOne();
smn.tino
  • 2,272
  • 4
  • 32
  • 41
user1088259
  • 345
  • 13
  • 34

1 Answers1

0

The ManualResetEvent.WaitOne method has the overload that takes the time interval in milliseconds. You can use it to specify the timeout.

Eugene Yakush
  • 259
  • 4
  • 6