WebDriver:SwitchToWindow has to make use of `handle` argument if present in payload
Categories
(Remote Protocol :: Marionette, enhancement, P1)
Tracking
(firefox80 fixed)
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
Details
User Story
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
To get the usage of the name
argument removed without breaking backward compatibility between Firefox and geckodriver, we want to add the usage of the handle
parameter for now. Once that has been stabilized well enough throughout a couple of Firefox and geckodriver releases, we could finally fix bug 1301073.
The code which needs an update can be found at:
Here cmd.parameters.handle
needs to be checked for, and if present it needs to be handled with a higher priority than cmd.parameters.name
. It's value type is also String
, and will need a check/conversion to Number
for.
To verify the behavior is correct the following tests would have to be run:
https://searchfox.org/mozilla-central/source/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_content.py
https://searchfox.org/mozilla-central/source/testing/marionette/harness/marionette_harness/tests/unit/test_switch_window_chrome.py
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
With bug 1519053 we got the handle
argument added to geckodriver. That means it would be good to actually swap these parameters now, and fully get rid of name
in Marionette and geckodriver.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 4•4 years ago
|
||
bugherder |
It seems this change https://phabricator.services.mozilla.com/D83625 broke the compatibility between geckodriver 0.24.0 and firefox 80.0b1.
When I run Selenium Java test https://github.com/SeleniumHQ/selenium/blob/trunk/java/client/test/org/openqa/selenium/WindowSwitchingTest.java with geckodriver 0.24.0.
From geckodriver debug log, when switch to a window, I got log messages like this:
1596131351691 webdriver::server DEBUG -> GET /session/40bd9dfe-b75e-4643-ba4d-162b78f6aad0/window/handles
1596131351708 webdriver::server DEBUG <- 200 OK {"value":["45","10737418255","31"]}
1596131351717 webdriver::server DEBUG -> POST /session/40bd9dfe-b75e-4643-ba4d-162b78f6aad0/window {
"handle": "10737418255"
}
1596131351733 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"invalid argument","message":"Expected "handle" to be a string, got [object Undefined] undefined","stacktrace":"WebDriverError@chrome://marionette/content/error.js:175:5\nInvalidArgumentError@chrome://marionette/content/error.js:304:5\nassert.that/<@chrome://marionette/content/assert.js:479:13\nassert.string@chrome://marionette/content/assert.js:383:53\nGeckoDriver.prototype.switchToWindow@chrome://marionette/content/driver.js:1645:10\ndespatch@chrome://marionette/content/server.js:305:40\nexecute@chrome://marionette/content/server.js:275:16\nonPacket/<@chrome://marionette/content/server.js:248:20\nonPacket@chrome://marionette/content/server.js:249:9\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:501:20\n"}}
It seems a logical error to me since the "handle" value in the request is actually the string, but the marionette driver.js complained it's not.
Could anyone please let me know if this incompatibility is expected for old geckodriver 0.24.0?
OK, according to https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html#clients, geckodriver 0.24.0 only works up to firefox 79. So it's expected that it won't work with firefox 80.
Assignee | ||
Comment 7•4 years ago
|
||
Right, and I would suggest that you really update your geckodriver to the freshly released 0.27 to get all the bug and security fixes.
Updated•2 years ago
|
Description
•