As we known WebDriver protocol is design for automation test purpose. But the major browsers also provide DevTool protocol. In some cases the DevTool protocol could achieve more powerful interactions and operations compare to WebDriver.
My question is why there are two different protocols and what's the main difference between these two protocols? Is there any selection experience available to share for a project development?
Thanks in advance!
Reference:
DevTools
WebDriver:
Main difference between WebDriver protocol and DevTools protocol is that WebDriver protocol needs a middle man like browser-driver (eg: chrome-driver) which is a server that sits between the automation script and browser enabling browser control, but in case of DevTools protocol the automation script can directly talk to browser running in debug mode making headless automation pretty straight forward.
And Chrome driver internally uses DevTools protocol to control browser, so if we are using WebDriver protocol it will in turn use Devtools protocol to control browser.
If cross-browser testing is something important for the new testing tool, DevTools protocol may not be suitable now, as there is no standard yet and it is mostly work in progress. Otherwise DevTools protocol will be a great choice as it gives more control like intercepting request header, simulating network etc and makes headless automation way easier.
WebDriver supplies us a well-designed object-oriented API that can provide improved support for modern advanced web-applications created through dynamic web pages. In short, WebDriver is the remote control interface that enables us to introspect and control the user agents. It provides us a platform and language neutral wire protocol along with as a way for out-of-process programs to remotely instruct the behavior of Web Browsers.
The WebDriver Specification was published by the Browser Testing and Tools Working Group as Editor's Draft. Editor's Draft does not imply endorsement by the W3C Membership and may be updated, replaced or obsoleted by other documents at any time.
The Developer Tools Protocol is used by various Browsers, JavaScript Engines and debugging tools to:
Some of the Browser Engines and Browsers those have a built-in debugging protocol are:
Some of the adapters that exposes a common protocol:
Here you can find the list of adapters in RemoteDebug - Protocol Adaptors
1. Note that DevTools Protocol
for Firefox is Work In Progress
2. Note that DevTools Protocol
for Edge is Work In Progress
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With