The WebDriver Wire Protocol
The initial WebDriver Wire Protocol draft was a proposal that, all implementations of WebDriver that would communicate with the browser, or a RemoteWebDriver server shall use a common wire protocol. This wire protocol defined a RESTful web service using JSON over HTTP.
As per the initial proposal and practice some of the JSON Objects were as follows:
- WebElement JSON Object: The JSON representation of a WebElement for transmission over the wire. This object will have the following properties:
![WebElement JSON Object]()
- Capabilities JSON Object: Not all server implementations will support every WebDriver feature. Therefore, the client and server should use JSON objects with the properties listed below when describing which features a session supports.
- Desired Capabilities: A Capabilities JSON Object sent by the client describing the capabilities a new session created by the server should possess. Any omitted keys implicitly indicate the corresponding capability is irrelevant. More at DesiredCapabilities.
- Actual Capabilities: A Capabilities JSON Object returned by the server describing what features a session actually supports. Any omitted keys implicitly indicate the corresponding capability is not supported.
- etc
WebDriver W3C Specification
With the introduction of WebDriver W3C Specification the following standards were defined:
- WebDriver remote ends must provide an HTTP compliant wire protocol where the endpoints map to different commands.
- Though this standard only defines the remote end protocol, it puts no demands to how local ends should be implemented.
- Local ends are only expected to be compatible to the extent that they can speak the remote end’s protocol; no requirements are made upon their exposed user-facing API.
Commands
The WebDriver protocol is organised into commands. Each HTTP request with a method and template defined in this specification represents a single command, and therefore each command produces a single HTTP response. In response to a command, a remote end will run a series of actions known as remote end steps. These provide the sequences of actions that a remote end takes when it receives a particular command.
Endpoints
The table of endpoints below lists the method and URI template for each endpoint node command and their current support in ChromeDriver.
![chromeScreenshot]()
Outro
What is the difference between Protocol and Json Wire Protocol