test_add_photo_to_contact.py: " MarionetteException: MarionetteException: Error sending message to frame (NS_ERROR_NOT_INITIALIZED) "

RESOLVED FIXED

Status

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: onelson, Assigned: martijn.martijn)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

()

Attachments

(2 attachments)

Reporter

Description

4 years ago
Description:
When the user attempts to perform this test manually, adding a contact photo to an in-edit contact, they will observe no fault on their end. However, observing the test being performed via automation will yield similar results, but encounter an error before the test finishes.

* http://jenkins1.qa.scl3.mozilla.com/view/UI/job/flame-kk-319.mozilla-central.nightly.ui.functional.smoke/205/HTML_Report/
* http://jenkins1.qa.scl3.mozilla.com/view/UI/job/flame-kk.ui.adhoc/821/HTML_Report/

Repro Steps:
1) Update phone to 20150504010202
2) Open the Contacts app
3) Fill out all fields: name, phone number, email
4) Tap the '+' to add new contact photo
5) Select from Gallery
6) Tap 'Done' to finish cropping image

Actual:
UI returns to Contact in edit; test fails on return

Expected: 
UI returns to Contact in edit, fields remain as they were and test finishes succesfully


Traceback (most recent call last):
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_client-0.12-py2.7.egg/marionette/marionette_test.py", line 296, in run
testMethod()
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/tests/functional/contacts/test_add_photo_to_contact.py", line 51, in test_add_photo_from_gallery_to_contact
image.tap_crop_done()
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/apps/gallery/regions/crop_view.py", line 38, in tap_crop_done
Wait(self.marionette).until(lambda m: self.apps.displayed_app.src != self._src)
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.5-py2.7.egg/marionette_driver/wait.py", line 122, in until
rv = condition(self.marionette)
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/apps/gallery/regions/crop_view.py", line 38, in <lambda>
Wait(self.marionette).until(lambda m: self.apps.displayed_app.src != self._src)
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/gaia_test.py", line 106, in displayed_app
self.marionette.switch_to_frame()
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.5-py2.7.egg/marionette_driver/marionette.py", line 1160, in switch_to_frame
return self._send_message("switchToFrame", "ok", **kwargs)
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.5-py2.7.egg/marionette_driver/decorators.py", line 36, in _
return func(*args, **kwargs)
File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.5-py2.7.egg/marionette_driver/marionette.py", line 716, in _send_message
    self._handle_error(response)
  File "/var/jenkins/2/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.5-py2.7.egg/marionette_driver/marionette.py", line 752, in _handle_error
    raise errors.lookup(status)(message, stacktrace=stacktrace)
MarionetteException: MarionetteException: Error sending message to frame (NS_ERROR_NOT_INITIALIZED)

Device firmware (base) 	L1TC100118D0
Device firmware (date) 	04 May 2015 08:38:24
Device firmware (incremental) 	eng.cltbld.20150504.043813
Device firmware (release) 	4.4.2
Device identifier 	flame
Device memory 	219772 kB
Device serial 	7f86cae1
Device uptime 	0 days 0 hours 2 minutes 12 seconds
Gaia date 	02 May 2015 04:27:01
Gaia revision 	e18cce173840
Gecko build 	20150504010202
Gecko revision 	dc5f85980a82
Gecko version 	40.0a1

Reproducible manually: NO

Repro frequency: 5/5 failing automation

Observation:
The test appears to be failing at 'image.tap_crop_done()', though the image itself finishes cropping successfully after observing the test perform. This could mean a delay between finishing cropping a photo, and returning to the previous UI, resulting in the test looking for certain elements and being unable to find them.
Reporter

Updated

4 years ago
QA Whiteboard: [QAnalyst-Triage?][fxosqa-auto-backlog?]
Flags: needinfo?(pbylenga)
Assignee

Updated

4 years ago
Assignee: nobody → martijn.martijn
Assignee

Comment 1

4 years ago
I guess this has something to do with bug 1104624, comment 4.
Assignee

Updated

4 years ago
Depends on: 1104624
QA Whiteboard: [QAnalyst-Triage?][fxosqa-auto-backlog?] → [QAnalyst-Triage+][fxosqa-auto-backlog?]
Flags: needinfo?(pbylenga)
Assignee

Comment 2

4 years ago
23:04 jgriffin: mwargers: you can ask ato tomorrow; I think we used to catch the frame's unload event to handle this situation, but maybe that was broken recently

Andreas, do you know what's going on here?
This is a case where tapping a button, which closes the app, makes Marionette spew out errors.
Flags: needinfo?(ato)
Assignee

Comment 4

4 years ago
(In reply to Autolander from comment #3)
> Created attachment 8601179 [details] [review]
> [gaia] mwargers:1161088 > mozilla-b2g:master

This could be used as a workaround, if it can't be fixed in Marionette, quickly.
If a frame has been closed there is a requirement that your next step be to switch frame otherwise you will get errors. This was documented in  bug 1104624.

There is no link to the test, just the report so it is hard to see what the issue is without spending time hunting through the repository.
Assignee

Comment 6

4 years ago
(In reply to David Burns :automatedtester from comment #5)
> If a frame has been closed there is a requirement that your next step be to
> switch frame otherwise you will get errors. This was documented in  bug
> 1104624.

I tried using self.marionette.switch_to_frame() (which is supposedly switching to the system frame), but that didn't help at all. Or should I use something else?

> There is no link to the test, just the report so it is hard to see what the
> issue is without spending time hunting through the repository.

What do you mean? I included a link to the test in this bug: test_add_photo_to_contact.py
Flags: needinfo?(dburns)
Assignee

Comment 7

4 years ago
I tried this, but this also produces the same error more or less.
Assignee

Updated

4 years ago
No longer depends on: 1104624
Then this might be a real issue and will let ato investigate when he has a chance.
Flags: needinfo?(dburns)
Assignee

Comment 9

4 years ago
Comment on attachment 8601179 [details] [review]
[gaia] mwargers:1161088 > mozilla-b2g:master

Perhaps this is good to have as a workaround for now? Otherwise we need to disable this test on device until the Marionette issue gets fixed.
Attachment #8601179 - Flags: review?(jlorenzo)
Comment on attachment 8601179 [details] [review]
[gaia] mwargers:1161088 > mozilla-b2g:master

Looks like a good workaround. It fixed the problem on my device too. I tested against b2gdesktop, I haven't noticed any regression.
Attachment #8601179 - Flags: review?(jlorenzo) → review+
Assignee

Updated

4 years ago
Attachment #8601179 - Flags: review?(npark)
Comment on attachment 8601179 [details] [review]
[gaia] mwargers:1161088 > mozilla-b2g:master

made a minor comment.  otherwise, looks good to me.
Attachment #8601179 - Flags: review?(npark) → review+
Assignee

Comment 12

4 years ago
Followed up with the minor comment, made sure that njpark agreed with it on irc, Treeherder Try looked good:
https://github.com/mozilla-b2g/gaia/commit/818dfe16af9d2a6538ade02c3ddcac78f1b3ce6b

I'll file a follow-up bug about the original Marionette issue involved here.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Assignee

Updated

4 years ago
Depends on: 1164078
Assignee

Comment 13

4 years ago
I filed bug 1164078 for it.
Flags: needinfo?(ato)
You need to log in before you can comment on or make changes to this bug.