Closed Bug 1451916 Opened 6 years ago Closed 6 years ago

Add "chromeelement-9fc5-4b51-a3c8-01716eedeb04" identifier to geckodriver/webdriver

Categories

(Testing :: geckodriver, defect, P1)

Version 3
defect

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: kimberlythegeek, Assigned: ato)

References

Details

Attachments

(1 file)

A test that succeeded with a previous version of nightly is now failing when find_element_by_id is called.

The failing test: https://github.com/kimberlythegeek/lockbox-extension/blob/master/test/integration/tests/test_doorhanger.py

pytest output: https://gist.github.com/kimberlythegeek/9f90cb04e9f922a83ddea4cdb4a02205#file-doorhanger-test-L26-L37

driver.log: https://gist.github.com/kimberlythegeek/bbebc61505712e6e480445e78c305f7f#file-failed-to-extract-web-element-L444-L448

As shown in the driver.log file, the element exists and is found, but webdriver returns "Failed to extract Web Element from response"

Can be reproduced with a simple python file:

1) pip install selenium

2) run following file:

from selenium import webdriver

driver = webdriver.Firefox()
with driver.context('chrome'):
    element = driver.find_element_by_id('PanelUI-button')
driver.close()


results:

Traceback (most recent call last):
  File "extract_web_element.py", line 5, in <module>
    element = driver.find_element_by_id('PanelUI-button')
  File "/Users/ksereduck/.virtualenvs/tmp-5fbd0d2aab9bc298/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 351, in find_element_by_id
    return self.find_element(by=By.ID, value=id_)
  File "/Users/ksereduck/.virtualenvs/tmp-5fbd0d2aab9bc298/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 955, in find_element
    'value': value})['value']
  File "/Users/ksereduck/.virtualenvs/tmp-5fbd0d2aab9bc298/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
    self.error_handler.check_response(response)
  File "/Users/ksereduck/.virtualenvs/tmp-5fbd0d2aab9bc298/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Failed to extract Web Element from response
Yes, the cause for this problem is bug 1400233. We missed to update geckodriver first for the contentelement id. I requested a backout of the patch on the other bug for now.

Andreas, would you mind fixing this in geckodriver? If it is a quick fix, should we consider pushing it together with 0.20.1?
Flags: needinfo?(ato)
Summary: webdriver finds element, but returns "Failed to extract Web Element from response" → Add "chromeelement-9fc5-4b51-a3c8-01716eedeb04" identifier to geckodriver/webdriver
Here the appropriate trace output, which shows the problem in webdriver:

> 1522961662679	geckodriver::marionette	TRACE	-> 99:[0,63,"findElement",{"using":"css selector","value":"[id=\"lockbox_mozilla_com-browser-action\"]"}]
> 1522961662680	Marionette	TRACE	0 -> [0,63,"findElement",{"using":"css selector","value":"[id=\"lockbox_mozilla_com-browser-action\"]"}]
> 1522961662681	Marionette	TRACE	0 <- [1,63,null,{"value":{"chromeelement-9fc5-4b51-a3c8-01716eedeb04":"5554be5e-7c61-eb49-bb58-f251f055f710"}}]
> 1522961662682	geckodriver::marionette	TRACE	<- [1,63,null,{"value":{"chromeelement-9fc5-4b51-a3c8-01716eedeb04":"5554be5e-7c61-eb49-bb58-f251f055f710"}}]
> 1522961662682	webdriver::server	DEBUG	<- 500 Internal Server Error {"value":{"error":"unknown error","message":"Failed to extract Web Element from response","stacktrace":""}}
It is in appropriate to fix this in a point release.

It should be easy to fix, so feel free to do it if you have time.
Blocks: 1441204
Flags: needinfo?(ato)
(In reply to Dave Hunt [:davehunt] ⌚️UTC+0 from comment #4)
> Also seen in the daily FoxPuppet tests:
> https://travis-ci.org/mozilla/FoxPuppet/builds/362903075

Does FoxPuppet also use geckodriver?
Flags: needinfo?(dave.hunt)
> Does FoxPuppet also use geckodriver?

Yes, it's based on Selenium.
Flags: needinfo?(dave.hunt)
Assignee: nobody → ato
Status: NEW → ASSIGNED
Priority: -- → P1
Comment on attachment 8965685 [details]
Bug 1451916 - Have geckodriver recognise chrome elements.

https://reviewboard.mozilla.org/r/234534/#review240136

Works fine. Thanks.
Attachment #8965685 - Flags: review?(hskupin) → review+
Comment on attachment 8965685 [details]
Bug 1451916 - Have geckodriver recognise chrome elements.

https://reviewboard.mozilla.org/r/234534/#review240306

::: commit-message-5bc81:12
(Diff revision 2)
> +Technically a chrome element is not a web element, but geckodriver
> +treats it as such.  This is in line with previous behaviour but should at
> +some point be changed when WebDriver supports these types of extensions.
> +
> +This patch does not drop support for the legacy web element identifier
> +(ELEMENT) since it would entail dropping support for Firefox 55.

I would say: "Firefox 55 and later".
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/182f16b120df
Have geckodriver recognise chrome elements. r=whimboo
https://hg.mozilla.org/mozilla-central/rev/182f16b120df
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: