w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
356 stars 39 forks source link

Specify how to establish a connection #19

Closed foolip closed 4 years ago

foolip commented 4 years ago

https://github.com/w3c/webdriver/issues/1498 concerns what kinds of messages to exchange over a connection, but to get off the ground we also need to first enumerate possible connections and establish a connection. This would, I think, also be the "upgrade mechanism" for getting from a WebDriver HTTP connection to a BiDi connection.

Straw proposal, assuming an already created WebDriver session:

GET /session/{session id}/targets to enumerate targets to which one can connect. Among other information there would be a (WebSocket?) URL to connect to. That's all.

However, this is probably a flawed proposal, and it seems like the choices here will have large consequences. Questions that come to mind:

jgraham commented 4 years ago

I think a lot of this was discussed at previous F2F meetings and there was broad agreement:

foolip commented 4 years ago

That seems sensible. Does that imply that everything will always go over a single connection, or would there still be scenarios where there are multiple WebSocket endpoints or multiple connections to a single endpoint?

jgraham commented 4 years ago

One external-facing connection per session. Obviously internally a UA might have some more complex routing going on given multiprocess etc.

jgraham commented 4 years ago

Filed https://github.com/w3c/webdriver/pull/1523 to give us hooks to work with in the WebDriver spec.

jgraham commented 4 years ago

https://github.com/w3c/webdriver-bidi/pull/24 is an initial cut at this.

foolip commented 4 years ago

There are still a bunch of issues, but the basics of this have been specified.