Closed Bug 1191023 Opened 6 years ago Closed 6 years ago
_settings _do _not _track .py: "No Such Element Exception: Unable to locate element: //li/label[span[@data-l10n-id="do Not Track Actions"]]"
Description: test_settings_do_not_track.py is failing consistently today, on being unable to find an element it was previously referencing. * http://jenkins1.qa.scl3.mozilla.com/view/UI/job/flame-kk-319.mozilla-central.nightly.ui.functional.non-smoke.1/388/HTML_Report/ * http://jenkins1.qa.scl3.mozilla.com/view/UI/job/flame-kk.ui.adhoc/853/HTML_Report/ Repro Steps: 1) Update phone to 20150804030313 2) Open the Settings app 3) Open 'Do Not Track' settings 4) Observe 'do not track' options Actual: Test exits, can't find options Expected: Test modifies options and asserts accurate behavior Traceback (most recent call last): File "/var/jenkins/1/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_client-0.16-py2.7.egg/marionette/marionette_test.py", line 296, in run testMethod() File "/var/jenkins/1/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/tests/functional/settings/test_settings_do_not_track.py", line 28, in test_enable_do_not_track_via_settings_app do_not_track_settings.tap_disallow_tracking() File "/var/jenkins/1/workspace/flame-kk.ui.adhoc/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/do_not_track.py", line 25, in tap_disallow_tracking *self._disallow_tracking_checkbox_locator) File "/var/jenkins/1/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/marionette.py", line 1589, in find_element response = self._send_message('findElement', 'value', **kwargs) File "/var/jenkins/1/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/decorators.py", line 36, in _ return func(*args, **kwargs) File "/var/jenkins/1/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/marionette.py", line 715, in _send_message self._handle_error(response) File "/var/jenkins/1/workspace/flame-kk.ui.adhoc/.env/local/lib/python2.7/site-packages/marionette_driver-0.9-py2.7.egg/marionette_driver/marionette.py", line 751, in _handle_error raise errors.lookup(status)(message, stacktrace=stacktrace) NoSuchElementException: NoSuchElementException: Unable to locate element: //li/label[span[@data-l10n-id="doNotTrackActions"]] Environmental Variables: Device firmware (base) L1TC000118D0 Device firmware (date) 04 Aug 2015 10:32:54 Device firmware (incremental) eng.cltbld.20150804.063236 Device firmware (release) 4.4.2 Device identifier flame Device memory 219772 kB Device serial e477d887 Device uptime 0 days 0 hours 2 minutes 15 seconds Gaia date 03 Aug 2015 23:57:37 Gaia revision caba8b26c52d Gecko build 20150804030213 Gecko revision 5b54831761b1 Gecko version 42.0a1 Reproducible manually: No Repro frequency: 5/5
Looks like this commit may have broken it, the file 'do_not_track.html' is no longer referencing 'span' when identifying it's radio controls. Probably need to modify our CSS_SELECTORS for these buttons. * https://github.com/mozilla-b2g/gaia/commit/cffb0c75e995cc3f5e47ead7f6d4d837dcc8ce0f
Comment on attachment 8645081 [details] [review] [gaia] mwargers:1191023 > mozilla-b2g:master locally ran and passed, looks good to me.
Comment on attachment 8645081 [details] [review] [gaia] mwargers:1191023 > mozilla-b2g:master We already have this workaround at 3 other places than this patch. I think it's the right time to factorize the workaround, until bug 1113742 is fixed.
By the way, having less XPATH locators is awesome! CSS selectors looks simpler and are faster to execute by Marionette.
Johan, is there really benefit in doing this change you suggested in the pull request? I mean, there are several places where I still have the workaround where I can't use the suggested change you proposed: I can't use this here at least: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/contacts/regions/settings_form.py#43 And here: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/app.py#32 And here: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/regions/ftu_step3.py#39 And here: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/cost_control/regions/settings.py#48 The places where I could use it, are here: http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/keyboard.py#72 http://mxr.mozilla.org/gaia/source/tests/python/gaia-ui-tests/gaiatest/apps/contacts/regions/settings_form.py#47 And for this bug.
I see that https://www.w3.org/Bugs/Public/show_bug.cgi?id=26147 was fixed, which would allow bug 1113742 to be fixed, afaik. I needino-ed David Burns on that bug to see how that could be fixed.
Depends on: 1113742
Comment on attachment 8645081 [details] [review] [gaia] mwargers:1191023 > mozilla-b2g:master Ok, I think this is what you want. The only thing I did different was, is using the names "is_custom_element_checked" and "wait_for_custom_element_checked_state" for the methods, because I think that's more in line with what's used for other methods.
Comment on attachment 8645081 [details] [review] [gaia] mwargers:1191023 > mozilla-b2g:master the factorization seems straightforward, LGTM.
Comment on attachment 8645081 [details] [review] [gaia] mwargers:1191023 > mozilla-b2g:master It looks good to me.
Attachment #8645081 - Flags: review?(jlorenzo) → review+
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.