Selenium WebDriver W3C Commands and Use-cases

Babu Manickam
3 min readDec 19, 2022

--

All of my articles are free to read. If you don’t have a Medium subscription, you can still read by clicking this link.

The Selenium WebDriver W3C API is a standardized solution that was developed to conform to the W3C standards for browser automation. The These commands can be used to automate a wide variety of actions in browsers, including clicking on elements, typing into forms, navigating between pages and so on. It also provides support for handling JavaScript alerts, cookies, devtool integrations and other features of modern web browsers.

Common Use-cases for customising Selenium WebDriver W3C API

  1. Many a times, our Selenium automated test scripts used to fail due to StaleElementReferenceException, ElementClickInterceptedException, TimeOutException etc and that force us to debug to understand what is happening internally with that call to know where is the problem?
  2. While designing Webdriver wrappers, we need to customise the API request / response to decide a retry, limit to work like an user.

With that said, we spent several hours to know every webdriver API with details about:

  1. Request URL
  2. Verb
  3. Query Parameters / Body
  4. Response Code, Body

and built a postman collection that helped us to debug, customize the webdriver actions successfully.

How to use this PostMan Collection?

As noted earlier, the browser native driver (like chromedriver binary) is the sever that communicates to the browser (chrome). So you need to download the browser native driver based on your browser version and start that in your terminal (the default port will be 9515) or double click to start the exe in your windows box.

Confirm the driver has started successfully through hitting the browser with http://localhost:9515/ and confirm there is unknown command response.

Chromedriver Response in Browser

Now, import the postman collection in your machine and run each command to confirm the request and response of the WebDriver W3C API. For example, when you hit the ‘Chrome Driver Readiness’ API, the response is likely to be as below:

Here is the link for downloading PostMan collection: https://www.testleaf.com/WebDriverW3C.html

Happy Learning !! Let me know how useful this article is all about with your like and comments.

--

--

Babu Manickam
Babu Manickam

Written by Babu Manickam

Author, Speaker, Mentor and Coach - Test Automation & DevOps

No responses yet