Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirefoxDriver not respecting sequential timeouts #578

Closed
rvazarkar opened this issue May 27, 2015 · 1 comment
Closed

FirefoxDriver not respecting sequential timeouts #578

rvazarkar opened this issue May 27, 2015 · 1 comment

Comments

@rvazarkar
Copy link

After raising a TimeoutException, the Firefox Webdriver will fail to respect a second one immediately afterwards. The issue can be reproduced using the following code:

from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import time

if __name__ == '__main__':
    driver = webdriver.Firefox()
    driver.set_page_load_timeout(5)
    for i in xrange(0, 10):
        try:
            t1 = time.time()
            driver.get('http://deelay.me/20000/http://www.google.com')
            driver.save_screenshot('/root/screen')
            t2 = time.time()
            print 'finished ' + str(i)
            print t2-t1
        except TimeoutException:
            print 'caught timeout ' + str(i)
    driver.quit()

The first iteration will properly timeout after 5 seconds, while the second iteration will not complete until the page fully loads (intentionally delayed by 20 seconds in the example).

This will cause Selenium to hang completely if it encounters a page that never loads (such as real time data that continuously polls) provided it has already timed out once before.

@barancev
Copy link
Member

The issue is still actual in legacy Firefox driver, but it's not going to be fixed.

New Firefox driver implementation (aka geckodriver) does not suffer from this issue.
Tested on Selenium 3.5.2 + geckodriver 0.18 + Firefox Nightly 57

barancev added a commit that referenced this issue Aug 27, 2017
…t page load timeout once and handle sequential pages with load timeouts.
Tom-Trumper pushed a commit to Tom-Trumper/selenium that referenced this issue Sep 11, 2017
…able to set page load timeout once and handle sequential pages with load timeouts.
@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants