G
G
Gadd2016-12-12 23:27:42
Java
Gadd, 2016-12-12 23:27:42

How to make Firefox understand pageLoadTimeout in Selenium Webdriver?

I'm getting started with web application testing. Set webdriver to timeout page loading:

driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);

In chrome, everything works fine, but if you choose Firefox, all tests fail. The pages do not have time to load, the necessary elements are not found, and the tests fail.
I came across this article . In short, Mozilla decided that it was too difficult to maintain such functionality, and they did not cut it out. Offer to catch any visible elements of the page.
I'm trying to redo the tests for Firefox now, but it turns out to be very inconvenient, especially when in some cases you need to login before the page test (that is, the expected page is not loaded, the driver waits 10 seconds and then the test crashes, in chrome - the page is loaded, it becomes visible, that this is not the page, the exception is caught and goes to the login).
What's odd about this situation is that the link above is the only source I've found that points to this behavior. Maybe I misunderstood something?
Sorry for the confusion, now the mess in my head after Firefox'a, I'm still learning.
Is there an easy way to force Firefox to timeout for page loading?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question