Closed Bug 1819029 Opened 7 months ago Closed 7 months ago

Wrap response within a "value" field based on WebDriver commands and not the result's data type


(Remote Protocol :: Marionette, defect, P1)



(firefox112 fixed)

112 Branch
Tracking Status
firefox112 --- fixed


(Reporter: whimboo, Assigned: whimboo)


(Blocks 1 open bug)


(Whiteboard: [webdriver:m6][wptsync upstream][webdriver:relnote])


(2 files)

As seen on bug 1793845 comment 2 and following we are sending a response in Marionette based on the returned value. This is just broken and need to be fixed.

We could update individual methods that have to use value and return the correct structure already there, or we would need an exclusion list in server.sys.mjs so that we do not wrap all results in a value field.

Commands that return a non-value keyed result are:

  • Marionette:Quit
  • WebDriver:CloseChromeWindow
  • WebDriver:CloseWindow
  • WebDriver:GetCookies
  • WebDriver:GetTimeouts
  • WebDriver:GetElementRect
  • WebDriver:GetWindowHandles
  • WebDriver:GetWindowRect
  • WebDriver:FindElements
  • WebDriver:NewSession
  • WebDriver:GetWindowRect

All of those would violate the WebDriver specification so geckodriver fixes it up. As such changing the response to make them all spec compliant will be a breaking change for geckodriver and in some cases for Marionette client as well when used outside of mozilla-central (eg. wpt runner).

As such I would propose to exclude these commands from using a value key in server.sys.mjs.

I pushed a try build for the above list:

As it looks like there are other WebDriver commands as well, where we do not see the proper response returned (eg. print) where geckodriver fails only because the commands are not implemented in Marionette client.

Nevertheless I think that the exclusion list is better. So lets discuss.

I was wrong with the print command. It actually returns a result wrapped in value itself. Removing that will make all the related print tests passing.

Follow-up try build that will hopefully pass now even for reftests:

Summary: Sending a response should use a "value" field based on method and not data type → Wrap response within a "value" field based on WebDriver commands and not the result's data type
Assignee: nobody → hskupin

We haven't had the time to discuss this bug in the triage session, and I think it's not really needed anymore given that a patch has already been uploaded.

Points: --- → 1
Priority: -- → P1
Whiteboard: [webdriver:triage]
Whiteboard: [webdriver:m6]
Pushed by
[marionette] Fix returning response wrapped in "value" field. r=webdriver-reviewers,jdescottes
[wdspec] Enhance tests for execute (async) script for primitive values. r=webdriver-reviewers,jdescottes
Created web-platform-tests PR for changes under testing/web-platform/tests
Whiteboard: [webdriver:m6] → [webdriver:m6], [wptsync upstream]
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Upstream PR merged by moz-wptsync-bot
Blocks: 1823355
Whiteboard: [webdriver:m6], [wptsync upstream] → [webdriver:m6][wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.