# What is selenium WebDriver?

&#x20;WebDriver in selenium is an Interface and it is designed to overcome some limitations of selenium RC.\
&#x20;Selenium WebDriver is also known as Selenium 2.

&#x20;Selenium 2 supports most of all browsers to run your test cases and many programming languages like C#, Java, Python, Ruby, .Net, Perl, PHP, etc.. to create and modify your test scripts.

![](https://106491783-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTW0eWU2biq082hmKEn%2F-LTkw516BXeHHRcumXM3%2F-LTkwW1UN-R98TMzgFL9%2Fimage.png?alt=media\&token=a25b7bf2-6ee1-43a1-aa16-d7fd15a1bec9)

&#x20;You first need to launch a separate application called Selenium Remote Control (RC) Server before you can start testing

* &#x20; Selenium RC Server "injects" a Javascript program called Selenium Core into the browser.
* &#x20;Once injected, Selenium Core will start receiving instructions from the RC Server from your test program.
* &#x20; When the instructions are received, Selenium Core will execute them as Javascript commands.&#x20;
* &#x20;The browser will execute the instructions of Selenium Core, and will relay its response to the RC Server.&#x20;
* &#x20;RC Server will fetch the next instruction from your test script to repeat the whole cycle.

![](https://106491783-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTW0eWU2biq082hmKEn%2F-LTkw516BXeHHRcumXM3%2F-LTkwhr6BB0GMbQMZUn8%2Fimage.png?alt=media\&token=4972beda-0113-4da3-aafa-1e19ea8181a5)

* &#x20; Selenium WebDriver does not require selenium server for running test.&#x20;
* &#x20;It controls the browser from the OS level&#x20;
* &#x20;All you need are your programming language's IDE (which contains your Selenium commands-e.g. Eclipse) and a browser.

#### &#x20;Advantages:

&#x20; Speed WebDriver is faster than Selenium RC since it interacts directly to the browser WebDriver is faster than Selenium RC since it interacts directly to the browser

#### &#x20;Browser Support

&#x20;WebDriver can support the headless HtmlUnit browser.HtmlUnit is termed as "headless" because it is an invisible browser - it is GUI-less.It is a very fast browser because no time is spent in waiting for page elements to load.

#### &#x20;API&#x20;

WebDriver's API is simpler than Selenium RC's. It does not contain redundant and confusing commands like RC. \*\* RC contain redundant and confusing commands like type or typeKeys, click, mouseDown, or mouseDownAt etc

#### &#x20;Disadvantages:

&#x20;It cannot readily support new browsers, but Selenium RC can.

&#x20;It does not have a built-in command for automatic generation of test results

#### &#x20;WebDriver Configuration

&#x20;Step 1: Download and install Java in your system

&#x20;Step 2: Download and install Eclipse&#x20;

Step 3: Download WebDriver Jar Files. (http://www.seleniumhq.org/)&#x20;

Step 4: Start Eclipse and configure it with selenium WebDriver

* &#x20;Select Workspace on eclipse start up&#x20;
* &#x20;File > New > Project > Java Project
* &#x20; Create new package> Create New Class
* &#x20; \> Add external jar files
* &#x20; Right click on project > Select Properties > Select Java build path > Navigate to Libraries tab Click on add external JARs button > Browse the Jar Files to add.

#### &#x20;Example:

&#x20;http://www.popuptest.com/popuptest1.html

![](https://106491783-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTW0eWU2biq082hmKEn%2F-LTkw516BXeHHRcumXM3%2F-LTky3WnhMc0qnEmz5EI%2Fimage.png?alt=media\&token=d6f44965-de37-4a0c-81d2-8283c92ed876)

![](https://106491783-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTW0eWU2biq082hmKEn%2F-LTkw516BXeHHRcumXM3%2F-LTky7osnoraSisGQ1bd%2Fimage.png?alt=media\&token=e2d6f8f4-53eb-49ff-a304-ec2f221064ac)
