Selenium-9 || Understanding WebDriver API.

Selenium WebDriver is a powerful tool in selenium package. It helps to identify the component on a web browser, perform an action, comparing the result and generating the reports.

Before starting this chapter I would suggest please go through with Chapter 1 of Selenium section:

WebDriver API

Basically, API stands for Application Program Interface. These resources or programs used to interact between two different platforms. In this case, these two platforms are Java Program and Web Browsers. The below image is showing the same relationship or process for WebDriver API.

WebDriver Architecture
WebDriver API

WebDriver API is basically a client/server process. However, as this is only at a conceptual level, to avoid any confusion these terms have been replaced with “local” and “remote” end.

Local End

It is a user-facing API. Basically, In this, we have to just declare the command(s) which can be utilized in the actual Java programs during the coding phase.

For example, we all aware of the get() method under the WebDriver class, which is used to launch the browser as mentioned below:

public get(String URL);

We could find a declaration of the above method in the file named “” by locating path “selenium-java-2.40.0-srcs.jar\org\openqa\selenium“.

Please note that these files would be present under source zip folder like “selenium-java-2.40.0-srcs.jar

Remote End

These files contain the implementation of the user-interface APIs.

For example, Implementation of the above method get() would be defined in file. This file can be located at mentioned path selenium-java-2.40.0-srcs.jar\org\openqa\selenium\htmlunit.

You can find below method in file:

public void get(String url) {
    // Prevent the malformed url exception.
    if (WebClient.URL_ABOUT_BLANK.toString().equals(url)) {

    URL fullUrl;
    try {
      fullUrl = new URL(url);
    } catch (Exception e) {
      throw new WebDriverException(e);


As described above method all the remaining APIs written in the same way. All these files are together combined and converted into a jar file after compilation for further use.

We need to just import these jar files into our Java project. Also, the same way we could create other APIs.

For detailed information on WebDriver API, please refer below link:

13012total visits,12visits today

Leave a Reply

Your email address will not be published. Required fields are marked *