The WebDriver API allows browsers to be automated, such as for end-to-end testing. Specific implementations exist, such as the standalone ChromeDriver or InternetExplorer Driver executables or the FireFoxDriver extension. These implementations take commands sent over the JSON Wire Protocol. Please correct this if I'm wrong.
My questions is two-fold:
- What protocol do the WebDriver implementations use to talk to the browser?
- Why don't browsers implement the JSON Wire Protocol directly? It seems that the WebDriver bit must implement both JSON Wire and whatever protocol it uses to talk to that browser, and then the browser must implement that protocol as well. This seems like a considerable duplication of effort.
The argument that browser size should be minimized seems relatively weak, since browsers have to implement the latter protocol anyway.
The Selenium docs claim that
[the term "server"] may also refer to a specific browser that implements the wire protocol directly, such as the FirefoxDriver or IPhoneDriver
That doesn't make sense - FirefoxDriver isn't a browser. As far as I can tell, it's an XPI extension for Firefox.
UPDATE: I've asked the question on the Selenium Developers mailing list and it seems that the WebDriver-browser protocols are undocumented and vendor-specific.