.text doesn't get the title's text in desktop b2g

RESOLVED WONTFIX

Status

Testing
Marionette
RESOLVED WONTFIX
5 years ago
4 years ago

People

(Reporter: mdas, Unassigned)

Tracking

Trunk
x86
Other
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Calling .text on a title dom element doesn't return expected values on desktop B2G in the Browser app.

This test: https://github.com/mozilla/gaia-ui-tests/blob/master/gaiatest/tests/browser/test_browser_search.py#L33 fails on line 33 because .text returns an empty string instead of the expected title. The funny thing is, this passes on the phone, just not on desktop B2G.

FYI, if you change line 33 to .get_attribute("innerHTML"), then it passes on both desktop B2G and phone.

Passes on the phone:
http://qa-selenium.mv.mozilla.com:8080/view/B2G/job/b2g.unagi.gaia.nightly.ui/175/console

Fails on desktop b2g with:

======================================================================
FAIL: test_browser_search (test_browser_search.TestBrowserSearch)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdas/code/gaia-ui-tests/gaiatest/tests/browser/test_browser_search.py", line 35, in test_browser_search
    self.marionette.find_element(*self._title_locator).text)
TEST-UNEXPECTED-FAIL | test_browser_search.py TestBrowserSearch.test_browser_search | AssertionError: 'Bing : Mozilla Web QA' != u''
----------------------------------------------------------------------
Ran 1 test in 5.273s
I can confirm that this isn't a timing issue either. I've added 5 second sleeps before line 32, and still fails.
Blocks: 857622
I think we should be using marionette.title here...
(In reply to Dave Hunt (:davehunt) from comment #2)
> I think we should be using marionette.title here...

agreed, but this highlights that .text doesn't seem to be doing what we want. 

https://github.com/mozilla/gaia-ui-tests/blob/c274a4b2b94085f38c85106f4c62a9717a7116a2/gaiatest/tests/browser/test_browser_search.py#L33 is a link to the line in question, since we're going to replace this with marionette.title in the future.
I've submitted a pull request to fix the test: https://github.com/mozilla/gaia-ui-tests/pull/638

Comment 5

5 years ago
This sounds like an is_displayed() error.
No longer blocks: 857622
getElementText on a <title> element will return u'' since the element, while it shows in desktop browsers title bar, isnt actually a visible element so this is working as intended.

as mentioned by :davehunt in comment #2 we should use marionette.title or we can use JavaScript to get the value
Closing this since marionette.title or execute_script can handle this situation. THe current implementation follows Webdriver (spec prose still to be written)
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.