Closed
Bug 705797
Opened 13 years ago
Closed 12 years ago
Get weird stack trace when browser returns undefined
Categories
(Remote Protocol :: Marionette, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: wlach, Unassigned)
References
Details
Attachments
(1 file)
1.05 KB,
patch
|
mdas
:
review+
|
Details | Diff | Splinter Review |
The following script ... m = marionette.Marionette(host='localhost', port=2828) m.start_session() m.execute_script("return undefined;") ... yields this stacktrace: Traceback (most recent call last): File "t.py", line 8, in <module> m.execute_script("return undefined;") File "/home/wlach/src/marionette_client/marionette/marionette.py", line 254, in execute_script response = self._send_message('executeScript', 'value', value=script, args=script_args) File "/home/wlach/src/marionette_client/marionette/marionette.py", line 143, in _send_message self._handle_error(response) File "/home/wlach/src/marionette_client/marionette/marionette.py", line 172, in _handle_error raise MarionetteException(message=response, status=500) marionette.errors.MarionetteException: error: {u'from': u'conn12.marionette1'} stacktrace: None
Reporter | ||
Comment 1•13 years ago
|
||
It would be great if we got a more sensible exception/error instead.
Comment 2•13 years ago
|
||
We also get an unhelpful error if we try to start a session with a machine/port that we can't connect to.
Comment 3•13 years ago
|
||
When I run the command, I'm getting something slightly different: >>> from marionette import Marionette >>> marionette = Marionette('localhost', 2828) >>> marionette.start_session() u'session-b2g' >>> marionette.execute_script("return undefined;") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "marionette.py", line 275, in execute_script response = self._send_message('executeScript', 'value', value=script, args=args) File "marionette.py", line 145, in _send_message self._handle_error(response) File "marionette.py", line 174, in _handle_error raise MarionetteException(message=response, status=500) errors.MarionetteException
Comment 4•13 years ago
|
||
(In reply to John Hammink from comment #3) > When I run the command, I'm getting something slightly different: > > >>> from marionette import Marionette > >>> marionette = Marionette('localhost', 2828) > >>> marionette.start_session() > u'session-b2g' > >>> marionette.execute_script("return undefined;") > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "marionette.py", line 275, in execute_script > response = self._send_message('executeScript', 'value', value=script, > args=args) > File "marionette.py", line 145, in _send_message > self._handle_error(response) > File "marionette.py", line 174, in _handle_error > raise MarionetteException(message=response, status=500) > errors.MarionetteException If you use the existing unittests as a template, you don't need to create a Marionette instance or call start_session...those things are done for you. You can use 'self.marionette' in the test code to access the Marionette instance. Additionally, scripts are not allowed to return 'undefined'; we currently force them to return a value, otherwise we error out. I'm not sure we definitely want to do this, though; I think it makes sense to allow scripts to returned undefined.
Comment 6•13 years ago
|
||
This seems like an easy fix. A couple of tests will also have to change.
Attachment #588563 -
Flags: review?(mdas)
Comment 7•12 years ago
|
||
Comment on attachment 588563 [details] [diff] [review] patch Review of attachment 588563 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thanks for getting this done! Depending on what I get done today, I may push these changes out. I will update the bug if so. Otherwise, feel free to push them on Tuesday and I'll merge my impending changes with this.
Attachment #588563 -
Flags: review?(mdas) → review+
Comment 8•12 years ago
|
||
Landed as https://github.com/jonallengriffin/mozilla-central/commit/d468098cacb9d8c82cbb12c11c603c82e2a40062 and https://github.com/jonallengriffin/marionette_client/commit/624c5ae8c0345e2a02e5d070979c974c1861affc
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•1 year ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•