selenoid icon indicating copy to clipboard operation
selenoid copied to clipboard

Add BiDi support

Open gdonati78 opened this issue 11 months ago • 6 comments

In Selenium 4 there are constantly new features added that are based on the BiDirectional protocol. I'm specifically interested in e.g. the console log, but also the mutation observation

As far as I understand it also uses WebSocket like the existing CDP (something was added in https://github.com/aerokube/selenoid/issues/1063).

gdonati78 avatar Mar 08 '24 09:03 gdonati78

@gdonati78 WebDriver BiDi is not an approved standard (like W3C WebDriver is), it's only a draft. Console log and mutation observation should be already available using CDP. I'm not even sure that Selenium client does not rely on CDP internally for BiDi functionality.

vania-pooh avatar Mar 11 '24 07:03 vania-pooh

If I understand it correctly, the Selenium client seems indeed to rely on the CDP for mutation observation, but the console log functionality we are interested into is using W3C compliant BiDi, see links above or directly https://www.selenium.dev/documentation/webdriver/bidirectional/ While the specification is in works, the browser vendors are parallely implementing the [WebDriver BiDirectional Protocol](https://w3c.github.io/webdriver-bidi/). Refer [web-platform-tests dashboard](https://wpt.fyi/results/webdriver/tests/bidi?label=experimental&label=master&aligned&view=subtest) to see how far along the browser vendors are. Selenium is trying to keep up with the browser vendors and has started implementing W3C BiDi APIs. The goal is to ensure APIs are W3C compliant and uniform among the different language bindings.

gdonati78 avatar Mar 11 '24 08:03 gdonati78

@gdonati78 spec is in too early stage in our opinion. So far as Selenoid is backwards compatible, we don't want to reimplement things (and thus break backwards compatibility) if one day Selenium guys decide to change things slightly.

vania-pooh avatar Mar 12 '24 08:03 vania-pooh

It makes sense, thanks for the prompt answer @vania-pooh

gdonati78 avatar Mar 12 '24 08:03 gdonati78

For now, in Chrome, as I remember, BiDi is implemented using CDP internally. The goal of BiDi is to not rely on CDP at all in the future from Selenium side to have one common way of bidirectional communication. So even though CDP might be used, from Selenium we should already be able to use BiDi.

While the specification is in works, the browser vendors are parallely implementing the WebDriver BiDirectional Protocol. Refer web-platform-tests dashboard to see how far along the browser vendors are. Selenium is trying to keep up with the browser vendors and has started implementing W3C BiDi APIs. The goal is to ensure APIs are W3C compliant and uniform among the different language bindings.

However, as @vania-pooh and @gdonati78 stated correctly, it is not accepted standard yet.

An editor's draft is a document allowing the Group to iterate internally on its content for consideration. Editor's Drafts are works in progress inside a W3C Group and are not required to have the consensus of the Group participants. These drafts have not received formal review and are not endorsed W3C. These drafts MUST NOT be cited as W3C standards and may or may not become W3C standards.

bischoffdev avatar Mar 12 '24 09:03 bischoffdev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 12 '24 01:05 github-actions[bot]