Return the "moz:debuggerAddress" as part of the capabilities when opted-in for Remote Agent
Categories
(Testing :: geckodriver, enhancement, P1)
Tracking
(firefox85 fixed)
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Regressed 1 open bug, )
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Similar to chromedriver that returns the address as part of the capabilities:
An address of a Chrome debugger server to connect to, in the form of <hostname/ip:port>, e.g. '127.0.0.1:38947'
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
To enable the remote agent currently two command line arguments are supported. See also bug 1669230 in what we might want to unify.
I think that we should use --remote-debugging-port
to start the remote agent, similar to what Puppeteer makes use of. Then we would have to retrieve the debugger URL from the error log. Not sure how easy that part will actually be, and if there might be a race condition.
Assignee | ||
Comment 2•4 years ago
|
||
Also I would vote to not enable the remote agent by default for a new webdriver session but always make it opt-in.
Comment 3•4 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #2)
Also I would vote to not enable the remote agent by default for a new webdriver session but always make it opt-in.
How would you opt in to it? How simple would it be?
It's important for the webdriver-bidi stuff that it's a case of "upgrading" so it can't be restarting the browser. People may update their tests to use the new Selenium Bidi APIs which try connect to a websocket at that point. People likely wouldn't want to send through a new capability.
Assignee | ||
Comment 4•4 years ago
|
||
We will most likely have a moz:firefoxOptions
capability that needs to be set to enable the Remote Agent like that:
moz:firefoxOptions: {
webSocketURL: true, // defaults to false
}
When the option is set to true
geckodriver will enable both Marionette and the Remote Agent when starting Firefox. Once a new session has been started the capabilities as returned by geckodriver would look somewhat like the following:
{
"value": {
"sessionId":"62f8a221-a1c4-cf46-8440-cd99806fa6c3",
"capabilities": {
"acceptInsecureCerts":false,
"moz:webSocketURL": "ws://localhost:9222",
...
}
}
}
I would have to check with Chrome first what debuggerAddress
and webSocketDebuggerUrl
actually are to give a clear answer in how the property names would look like. But as reading the Selenium code we would need the webSocketDebuggerUrl
.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Before we can actually go ahead with this opt-in feature I would like to make sure that we don't ship with regressions in our or Firefox' code. As such I would like to see the Puppeteer jobs running per commit (bug 1628589). This should give us more confidence for the stability of our code.
Comment 6•4 years ago
|
||
Why are we making this opt-in? Selenium bindings are likely to just turn it on as default in the bindings.
Comment 7•4 years ago
|
||
Selenium can obviously turn it on by default at their discretion, but I don't think it makes any sense to auto-start an additional server without some indication that the client is actually going to do something with that server. And doubly so for an implementation of a proprietary protocol.
Comment 8•4 years ago
|
||
Could we also include the version of CDP that you are supporting? We get this info when we get via the http request when asking for the webSocketURL in the following Selenium code
Assignee | ||
Comment 9•4 years ago
|
||
(In reply to David Burns :automatedtester from comment #8)
Could we also include the version of CDP that you are supporting? We get this info when we get via the http request when asking for the webSocketURL in the following Selenium code
Yes, the version
endpoint is already available for a long time:
https://searchfox.org/mozilla-central/source/remote/JSONHandler.jsm#22-24
We only might have to figure out how/when to update the version value.
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #4)
We will most likely have a
moz:firefoxOptions
capability that needs to be set to enable the Remote Agent like that:moz:firefoxOptions: { webSocketURL: true, // defaults to false }
This isn't going to work given that it shouldn't be a Firefox option but a capability. As such I will add a moz:webSocketUrl
flag to the capabilties, and it will return "moz:webSocketUrl":"localhost:9222"
as part of the returned capabilities. With that the code in Selenium should just work.
Assignee | ||
Comment 10•4 years ago
|
||
If set to true geckodriver will start Firefox with the
Remote Protocol enabled by using the --remote-debugging-port=0
command line argument.
The returned capabilities by the New Session command will
contain moz:debuggerAddress
that holds the "host:port"
of the HTTP server to query for debuggable websocket
connections.
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Description
•