0

I was using PhantomJSDriver to take screenshots of many urls.

The problem was that timeout occurs for some of urls. I examined those urls which have failed, and I realize those url takes long time for them to be 'fully' loaded.

I can't just extend pageLoadTimeout because it will take too much time to process all the urls. So, I would rather make PhantomJSDriver to not wait until the page is fully loaded.

Would it be possible for PhantomJSDriver to take screenshot after X seconds, whether it's fully loaded or not?

Thanks

Kevin JJ
  • 333
  • 1
  • 2
  • 9

1 Answers1

0

You can pause the execution of the running thread for sometime after url navigation and then take the screenshot.

driver.Navigate().GoToUrl(url);
Thread.Sleep(1000); // 1000 milli seconds
driver.GetScreenshot()
Matthew Verstraete
  • 6,335
  • 22
  • 67
  • 123
A Narsimha
  • 16
  • 2