selenium-google-code-issue-archive icon indicating copy to clipboard operation
selenium-google-code-issue-archive copied to clipboard

WebDriver will loop infinitely trying to load a page

Open lukeis opened this issue 8 years ago • 3 comments

Originally reported on Google Code with ID 7626

WebDriver will try to load a page with an unexisting element forever in certain cases.
This occurs in Selenium 2.42.1 using the Python bindings, with any driver - PhantomJS,
Firefox, Chrome. 

It seems to be triggered by elements that give a net::ERR_CONNECTION_RESET error in
Chrome (I do not know the specific HTTP error code, this is Chrome's representation
of the error, which is documented as being a TCP reset). To reproduce, you may attempt
to driver.get() the following URL: http://my.umbc.edu/discussions/6558. The driver
will attempt to get the page and then go idle. This is due to an element on the page,
<img src="http://rtsio.com/images/badkitty.gif">, that because of either some strange
javascript caching code or the configuration of the domain/hosting server to which
the dead link points to, will not return a regular 404, but the net::ERR_CONNECTION_RESET
if looking through Chrome's network inspector. Force-quitting the driver on Ubuntu
12.04 w/Python 2.7 yields the following stack trace:

^CTraceback (most recent call last):
  File "zz.py", line 15, in <module>
    driver.get('https://my.umbc.edu/discussions/6558')
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
line 185, in get
    self.execute(Command.GET, {'url': url})
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
line 171, in execute
    response = self.command_executor.execute(driver_command, params)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py",
line 347, in execute
    return self._request(command_info[0], url, body=data)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py",
line 415, in _request
    resp = opener.open(request)
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1180, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 407, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
    line = self.fp.readline()
  File "/usr/lib/python2.7/socket.py", line 447, in readline
    data = self._sock.recv(self._rbufsize)

Meaning the code handling that socket is either looping or has blocked and is waiting
for a response that will not come, because of a TSP RST flag.

Reported by Rostislav.Tsiomenko on 2014-07-19 18:28:43

lukeis avatar Mar 04 '16 08:03 lukeis

Similar to https://code.google.com/p/selenium/issues/detail?id=4319 and https://code.google.com/p/selenium/issues/detail?id=3951

Reported by Rostislav.Tsiomenko on 2014-07-19 18:41:33

lukeis avatar Mar 04 '16 08:03 lukeis

Reported by barancev on 2014-07-21 19:34:32

  • Labels added: Lang-Python

lukeis avatar Mar 04 '16 08:03 lukeis

Reported by luke.semerau on 2015-09-17 17:47:04

  • Labels added: Restrict-AddIssueComment-Commit

lukeis avatar Mar 04 '16 08:03 lukeis