While we're busy working on WebDriver BiDi, many of the new features of Selenium 4 are actually based on the current debugging protocol. As the name suggests, this is a protocol used by the chromium-based browsers for their debuggers, and they're typically accessible through dev tools. Because it always expects to be running locally, this is a really chatty protocol, but it does allow great introspection into the browser itself and so it can be really useful for testing.
If you need something that Selenium doesn't provide, but CDP does, you can make use of the HasDevTools API to access the raw CDP protocol. I'm not going to demonstrate it here because there are some serious drawbacks to it. The most major of these is at CDP versions are tied to specific browser versions. So if you head down this route, you'll also be tied to that specific browser and that specific version of the browser.
Fortunately, Selenium 4 can speak multiple versions of the protocol. So if you do want to test with Chrome 88 and Edge 89 at the same time, that's easy to do and well supported by Selenium.
Comments are closed.