Closed Bug 758195 Opened 8 years ago Closed 6 years ago

Find Element of an element that will never exist and has a search_timeout will cause a socket.timeout instead of NoSuchElementException

Categories

(Testing :: Marionette, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla26

People

(Reporter: automatedtester, Assigned: automatedtester)

References

Details

Attachments

(1 file, 1 obsolete file)

If something happens to the socket we should try bind back to Gecko and try reuse the session. If it fails then we should leave it to the user to correct

See log from Selenium Proxy where the unexpected disconnect then causes exceptions to tell the user to create a new session

2012-05-24 12:12:51,612 - Selenium-Proxy - DEBUG - /url - {u'url': u'http://localhost:8012/formPage.html', u'sessionId': u'13'} - 13 - None
1800 2012-05-24 12:12:51,612 - Selenium-Proxy - INFO - Navigating to http://localhost:8012/formPage.html - 13
1801 2012-05-24 12:12:51,885 - Selenium-Proxy - DEBUG - /element - {u'using': u'name', u'sessionId': u'13', u'value': u'there is no spoon'} - 13 - None
1802 2012-05-24 12:12:51,885 - Selenium-Proxy - INFO - Find Element using - name, value - there is no spoon  - 13
1803 2012-05-24 12:15:51,890 - Selenium-Proxy - CRITICAL - Server Exception: Traceback (most recent call last):
1804   File "selenium_proxy.py", line 216, in do_POST
1805     value={'ELEMENT': str(self.server.marionette.find_element(body['using'], body['value'], id=element))})
1806   File "/Users/davidburns/.virtualenvs/seleniumproxy/lib/python2.7/site-packages/marionette-0.2-py2.7.egg/marionette/marionette.py", line 343, in find_element
1807     response = self._send_message('findElement', 'value', **kwargs)
1808   File "/Users/davidburns/.virtualenvs/seleniumproxy/lib/python2.7/site-packages/marionette-0.2-py2.7.egg/marionette/marionette.py", line 163, in _send_message
1809     raise TimeoutException(message='socket.timeout', status=21, stacktrace=None)
1810 TimeoutException: socket.timeout
1811 
1812 2012-05-24 12:15:51,921 - Selenium-Proxy - DEBUG - /url - {u'url': u'http://localhost:8012/formPage.html', u'sessionId': u'13'} - 13 - None
1813 2012-05-24 12:15:51,922 - Selenium-Proxy - INFO - Navigating to http://localhost:8012/formPage.html - 13
1814 2012-05-24 12:15:51,932 - Selenium-Proxy - CRITICAL - Server Exception: Traceback (most recent call last):
1815   File "selenium_proxy.py", line 301, in do_POST
1816     assert(self.server.marionette.navigate(body['url']))
1817   File "/Users/davidburns/.virtualenvs/seleniumproxy/lib/python2.7/site-packages/marionette-0.2-py2.7.egg/marionette/marionette.py", line 265, in navigate
1818     response = self._send_message('goUrl', 'ok', value=url)
1819   File "/Users/davidburns/.virtualenvs/seleniumproxy/lib/python2.7/site-packages/marionette-0.2-py2.7.egg/marionette/marionette.py", line 145, in _send_message
1820     raise MarionetteException(message="Please start a session")
1821 MarionetteException: Please start a session
1822 
1823 2012-05-24 12:15:51,953 - Selenium-Proxy - DEBUG - /url - {u'url': u'http://localhost:8012/formPage.html', u'sessionId': u'13'} - 13 - None
1824 2012-05-24 12:15:51,953 - Selenium-Proxy - INFO - Navigating to http://localhost:8012/formPage.html - 13
1825 2012-05-24 12:15:51,954 - Selenium-Proxy - CRITICAL - Server Exception: Traceback (most recent call last):
1826   File "selenium_proxy.py", line 301, in do_POST
1827     assert(self.server.marionette.navigate(body['url']))
1828   File "/Users/davidburns/.virtualenvs/seleniumproxy/lib/python2.7/site-packages/marionette-0.2-py2.7.egg/marionette/marionette.py", line 265, in navigate
1829     response = self._send_message('goUrl', 'ok', value=url)
1830   File "/Users/davidburns/.virtualenvs/seleniumproxy/lib/python2.7/site-packages/marionette-0.2-py2.7.egg/marionette/marionette.py", line 145, in _send_message
1831     raise MarionetteException(message="Please start a session")
1832 MarionetteException: Please start a session
1833
Do you have a link to the test case that produced this error?
In this case it is a test case with an implicit wait for an element that will never be there. The implicit wait never throws and then the socket to Gecko times out
Attached patch Failing test case (obsolete) — Splinter Review
Summary: If there is a socket timeout while doing an action with marionette we should allow client to bind back to that session → Find Element of an element that will never exist and has a search_timeout will cause a socket.timeout instead of NoSuchElementException
Duplicate of this bug: 747152
This test passes locally now, so I've added it to the manifest and pushed it to try: https://tbpl.mozilla.org/?tree=Try&rev=679e219d29e2
try is green!
Attachment #626877 - Attachment is obsolete: true
Assignee: nobody → dburns
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a1bfe3e4d807
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.