What is the difference between WebDriver and DevTool protocol - selenium

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
https://learn.microsoft.com/en-us/microsoft-edge/devtools-protocol/
https://chromedevtools.github.io/devtools-protocol/
https://searchfox.org/mozillacentral/source/devtools/docs/backend/protocol.md
WebDriver:
https://www.seleniumhq.org/projects/webdriver/
https://www.w3.org/TR/webdriver1/
https://learn.microsoft.com/en-us/microsoft-edge/webdriver
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
https://sites.google.com/a/chromium.org/chromedriver/downloads

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
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.
WebDriver Specification
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.
DevTools Protocol
The Developer Tools Protocol is used by various Browsers, JavaScript Engines and debugging tools to:
Help web developers with a set of diagnostics tools which work well across a variety of targets.
To converge the need for target-specific devtools protocol adapters and simplify the experience for tool users and tool developers.
Provide a vendor-neutral platform to facilitate collaboration and mutual consensus building between different protocol implementations and interested clients.
Reduce the engineering investment necessary to build any further compatible protocol implementations as per user stories.
Some of the Browser Engines and Browsers those have a built-in debugging protocol are:
Chrome DevTools
WebKit / Safari
Node.js
Firefox 1 (in development)
Edge 2 ([in development] (link will be updated soon))
Some of the adapters that exposes a common protocol:
Microsoft Edge Diagnostics Adapter - will be replaced by the native support (mentioned above).
RemoteDebug iOS WebKit Adapter
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

Related

Is Selenium a security vulnerability?

I'm learning Selenium but I am concerned that the Webdriver (Chromedriver.exe, Geckodriver.exe) seems to open a port for communication functioning as a proxy between the selenium code and the browser. I don't want to expose myself to any vulnerabilities and would prefer some form of direct browser communication. I've viewed several solutions, but selenium just seems to be the reigning champion.
It appears that some form of what I am looking for was present with PhantomJS, but that seems to be no longer supported. This leaves me two options:
-Find a browser that selenium can communicate directly with without the aid of Webdriver.
-Find a way to completely restrict that port that it seems to open up so it does not allow connections from anybody on the network and no one can connect to my local machine.
Any suggestions folks?

Disable SNI in a modern browser

Is there a way to temporarily disable SNI in a modern browser?
E.g. to test a website availability for older clients. (Should one worry about them since POODLE?)
Probably the best way to test availability for older clients is to actually try out older clients. Microsoft provides VM images for browser compatibility testing at https://www.modern.ie/, which probably covers most of the desktop-based legacy clients, at least.
Another great resource for testing web site SSL/TLS compatibility in general is the Qualys SSL Server Test, which tries all the protocols and gives a simulation of what cipher suites browsers will be negotiating, as well as other useful information.
I'm not aware of any specific modern browser setting for disabling SNI specifically. Probably it'd open up a whole bunch of code paths that would need testing for not really any benefit, and support for it is probably deep within whatever library the browser is using for SSL/TLS support.

Open standard for native RTC with no plugins

Recently I have worked using WebRTC and I'm wondering if it would make more sense to implement a Real Time Communication open standard at a native level.
Let's say that instead of a web browser API we have a native API that any native app, including the browser can leverage.
Part of the promise of WebRTC is to have RTC on the browser without plugins but why stop there, why not have RTC on any device with media capabilities without plugins. There are many devices with media capabilities that will not run a web browser, e.g., wearables. It seems to me that the browser itself has become the plugin and I think we need to get rid of it as far as RTC is concerned.
It sounds like OpenWebRTC is going in a similar direction but so far they are only working inside the browser.
Are there open standards for native RTC? So far it looks like RTCWeb is only concerned about the browser.
Are there any projects/initiatives for native implementations of an open standard for RTC?
webrtc definition. webrtc is stuck into two parts, complementary but separated. the W3C consortium is standardizing a JS API for browsers named webRTC. The IETF is standardizing the underlying protocols and what happen on the wire for interoperability, it is named rtcweb.
the IETF's rtcweb group defines everything you need to interoperate with a browser, without being a browser yourself, i.e. for gateways, devices, .... It has been made explicit at the latest meeting in hawaii last november, and there is for example a corresponding draft.
On the client side, the implementation of webRTC JS API is done on top of c/C++ implementations. Those "native" (as in non-browser, C/C++) APIs can be use directly for servers, embeddable devices, gateway, ect, or can also be wrapped in different languages (obj-c, java) to provide "native" (as in mobile native) APIs.
Note that BOTH openWebrtc.io and webrtc.org have a full implementation of webRTC in C/C++ that you can use. openWebrtc provides iOS wrappers, and webkit wrappers (for safari), but do not provide data channel support, ORTC API support, nor compile under windows. webrtc.org supports all desktop OSes, and provide wrappers for both iOS and Android. The build tools are specific to google's chrome though, unlike openWebRTC which uses standard auto tools, github, ...
HTH
Currently there is no effort in this direction. The guys in the webrtc standardization committee have their hands full standardizing just the javascript API. As you know the current spec is not final and is currently still worked on. And now ORTC will generate even more work.
There are many reasons why no one is currently trying to standardize any form of native RTC. Here are some that come to my mind:
What exactly is native? Javascript is native for the browsers. The chrome version of webrtc is in C++ but the OpnWebRTC one is in C. Android developers use mostedly Java, iOS developers use ObjectiveC. Should there be standards for all these languages? That's going to take forever.
As I said standardization committee already have their hands full.
There is still quite a lot of experimentation that goes on with WebRTC. Standardization may prevent this.
The API of the native libraries tend to be very similar to the JS API.

webbacked selenium not supporting captureNetworkTraffic method

i am using webdriverbackedSelenium for my tests , i see that it isn't supporting capture network traffic method. can anyone tell me when webdriverbackedselenium is extending default selenium why isn't it supporting captureNetworkTraffic method
Selenium WebDriver and Selenium RC use fundamentally different mechanisms to automate the browser. RC installed itself as a proxy in some modes of operation, which allowed it to capture all communications between browser and web server. WebDriver's philosophy is designed to more closely emulate the user's experience, including not blindly installing a proxy without the user's knowledge, so WebDriver is not able to capture that traffic by default.
Selenium RC is deprecated, and has been for over two years. It is receiving no attention from the development team, and is unlikely to be improved in the future. However, since many people have significant investments in code using the RC API, the project provides a bridge class, WebDriverBackedSelenium. It is designed to allow you to migrate your RC code to WebDriver over time. It is not intended as a permanent solution. It does not, will not, cannot, and should not implement every single method of the Selenium RC API. It implements enough to allow your code to compile and mostly run, giving you the opportunity to change your code over to the WebDriver API.
If you absolutely require capturing network traffic to the browser using WebDriver, the API allows you to specify a proxy to use with the browser being automated. There are a number of proxies out there which allow you to capture, examine, and even modify the traffic to the browser. Some examples that people have used to good effect are BrowserMob proxy and Fiddler.

PPAPI Plugin and Chromium OS

I'm looking to use Chromium OS for a specific business application, but I need access to local serial and USB ports. My reading of the Chromium docs says NPAPI plugins are not supported in Chrome OS, only PPAPI (Pepper). I'm a bit confused about PPAPI, as all docs talk about this in the context of Native Client, which as it's a sandboxed environment, cannot access local resources.
So my basic question is: Is it possible to write a PPAPI browser plugin that will work like a regular NPAPI browser plugin to access local resources?
Currently, no. NPAPI plugins are on the way out, Native Client is a sandboxed environment, and Pepper's interfaces are designed to mirror those available elsewhere on the web platform (e.g. Javascript). So a good place to look for future interfaces would be draft web standards and HTML5/JS addons, e.g. for gamepads (https://wiki.mozilla.org/GamepadAPI) or cameras (http://developers.whatwg.org/video-conferencing-and-peer-to-peer-communication.html )