views:

314

answers:

1

Hello, when I set the Firefox proxy with python webdriver, it doesn't wait until the page is fully downloaded, this doesn't happen when I don't set one. How can I change this behavior? Or how can I check that the page download is over?

A: 

The simplest thing to do is to poll the page looking for an element you know will be present once the download is complete. The Java webdriver bindings offer a "Wait" class for just this purpose, though there isn't (yet) an analogue for this in the python bindings.

Simon Stewart
what if the page is loaded, but the element is not present? (say, some error happened on the site)
roddik
The short answer is to also check for common error states. The common solution is to set the timeout to be something like 30 seconds, and just have the test fail after that. The first answer (check for known conditions) is _far_ more robust.
Simon Stewart