JAR stands for Java Archive Files, to understand a jar file, de-compile it and then extracted files can help in understanding the underlying layers and architecture.

How to de-compile a JAR file

There are various opensource tools/software available using which a jar file can be de-compiled, I will be using one of the utility which is known as JD-GUI though there various other open source decompilers available

Download JD-GUI it from-http://jd.benow.ca/

please refer below screenshots

1 – Navigate to JAR which you want to de-compile.

2- Highlighted part is selenium webdriver which is defined as an interface.

What is selenium-

Answer-Selenium webdriver is an interface, it comes as a JAR file, to understand selenium webdriver one needs to de-compile it, post that structure of selenium webdriver can be understood. Using above JD-GUI de-compilation can be done.

Selenium architecture has four key components –

1-Selenium Client Library
2-JSON Wire Protocol over HTTP
3-Browser Drivers
4-Real Browsers

Selenium script pass command to selenium driver which interact with selenium binding/libraries using JSON protocol which then return it to browser and same helped real browser to execute the command.

So first Question is what is the purpose of making an interface-

Answer- In Java multiple inheritance is not allowed therefore interface plays a key role in achieving the same.
while creating object of ChromeDriver or FirefoxDriver we only write as-
WebDriver driver = new ChromeDriver / or New FirefoxDriver- That means we are using interface WebDriver and creating object or giving memory space for chromedriver/firefox driver. Using driver various methods/of different classes can be accessed, for accessing them WebDriver works as an interface.

Abstract classes and interface-which is widely used inside selenium jar as well as mostly recommended while designing a framework

Answer-In abstract classes method body can be defined we can use combination if abstract classes and interface by implementing interface to abstract class and extending the same abstract class by extending it, same can fulfill our purpose of re usability.

//Creating interface that has 2 methods
interface Class A{
void method1();//by default its , public and abstract
void method2();


//Creating abstract class that provides the implementation of one method of A interface
abstract class B implements Class A{
public void method3(){System.out.println(“I am in method 4”);}

//Creating subclass of abstract class, now we need to provide the implementation of rest of the methods
class M extends B{
public void method1(){System.out.println(“I am in method 1”);}
public void method2(){System.out.println(“I am in method 2”);}


//Creating a test class that calls the methods of A interface
class TestClass{
public static void main(String args[]){
A a=new M();



I am in method 1
I am in method 2
I am in method 3