Introduction
Welcome back Selenium seekers, in the previous article we discussed Selenium WebDriver Architecture both in Selenium 3 and Selenium 4. We also saw the roles of JSON Wire & W3C Protocols in their respective versions. Now, join us to understand the major differences between JSON Wire & W3C Protocols.
Differences between JSONWire & W3C Protocols
Differences Points | JSON Wire Protocol | W3C Protocol |
---|---|---|
Current Status | Retired from Selenium 4. | Current and Active Protocol. |
Where used? | Used in Selenium 3 WebDriver Architecture. | Used in Selenium 4 WebDriver Architecture. |
Purpose | Act as a channel between Client Libraries & WebDrivers by converting JSON requests into JSON HTTP requests and HTTP responses to JSON responses. | Act as a direct channel between Client Libraries & WebDrivers. No such conversion is needed. |
W3C Specification | Not fully adhered to W3C standardization. | Fully W3C compliant. |
Affect on script execution | It was slow, as it needs to convert JSON requests into HTTP request and HTTP responses into JSON responses. | Client Libraries could directly interact with Web Drivers, hence the execution is faster as compared to JSON Wire Protocol. |
Relative Locators. | No such concept of relative locators. | It includes modern features like relative locators. Examples: above(), below(), toLeftOf(), toRightOf(), near(), etc. |
Cross-browser compatibility | Less improved compatibility. | More improved compatibility due to the introduction of standardized API for interacting with different browsers. |
These were a few of the major differences in JSON Wire and W3C Protocols used in Selenium 3 and Selenium 4 WebDrivers Architectures. Due to the implementation of the World Wide Web Consortium (W3C) specifications, there are some major changes have been introduced such as what data structure being followed, errors code, and response status codes. For more details, please visit the W3C org website. Click Here.
Conclusion
To wrap up this article, we understood the major differences between JSON Wire & W3C Protocols. We also how the introduction of the W3C protocol changes the dimensions of Selenium WebDriver not only in terms of improved compatibility, and modern features like relative locators but also in terms of standardization and consistency.
Still, if you have any questions/queries please comment them below. We would try our best to answer them at earliest.
HAPPY LEARNING..!! 😊