Back2Pavillion | Free Selenium Tutorials | Selenium WebDriver | Take first step in Automation Testing with Selenium WebDriver

Take first step in Automation Testing with Selenium WebDriver

Today we will start our first tutorial on Selenium WebDriver. We firstly learn alphabets before making a single word. Similarly, we will learn introductory part of WebDriver that will ultimately help you further in your Automation Testing strategy. A Strong foundation is mandatory to build a multi-storey building. Isn’t it? 🙂

 

Why Selenium WebDriver for Automation Testing?

If we go back to the history of Selenium then we find the addition of WebDriver API was the primary and new feature to Selenium 2.0. It addressed major limitations of Selenium RC API, Hence, WebDriver offers simpler and concise programming interface.

Selenium WebDriver has the best solution to support dynamic web pages where elements are changing in each moment without entire page reload. It provided a better object oriented approach to automation testing of Web applications.

Selenium WebDriver

 

How does Selenium WebDriver work?

Selenium RC was using JavaScript techniques to inject command into the browser, so, that technique was taking much time. Whereas, Selenium WebDriver uses browser’s native language to send commands. It has inbuilt Drivers like FirefoxDriver, ChromeDriver, etc.

 

Do we need Selenium Server with WebDriver?

It totally depends on your requirement.

Let me break the ice.

If you are only using WebDriver API and undergoing automation testing in the same machine then you don’t need Selenium Server. Now the question comes- Where does Selenium Server require with Selenium WebDriver?

Let me reveal the beast.

Selenium Server requires in following conditions along with Selenium WebDriver:

  • Server & WebDriver are used altogether when you are using Selenium Grid to distribute test cases over multiple machines or Virtual machines
  • When you are using HTMLUnitDriver
  • When using browser with different version

 

How to set up Selenium WebDriver project for Automation Testing?

You need Selenium JAR files to make the environment on your system. Once you have JAR files then you need IDE (Integrated Development Environment). Next, you need a build tool, so I recommend Maven.

A separate chapter will be posted here on Maven so keep visiting.

Click here to download Selenium Standalone Server

Click here to download Selenium WebDriver Client for Java

Installation with Java

Installing WebDriver in Java by using Maven is quite easy. Here you don’t need to download JAR files; rather you just need to declare its dependencies in pom.xml. See snippet below from one of the projects:

 

Now for those who don’t want to use Maven then you need to upload JAR Files in Eclipse build path.

Right click on your project->Build Path->Configure Build Path->Add External JAR

Build path for Automation Testing

Automation Testing JAR

In the case of Maven configuration, you should be sure to give the latest version of Selenium server and WebDriver. Now go to command line and open project directory and give below command to run Maven.

Installation with C#

Microsoft Visual Studio is the best IDE for C# coders. Download latest Selenium dot net zip file. Unzip it and add a reference to each dlls to project in VS.

About Avinash Mishra

Avinash Mishra is the author of Inviul blog. He is a software engineer and blogger by choice. He loves to write blogs, and apart from blogging, he is interested in documentary film making, listening to music, traveling around the world and philanthropic activities.

Check Also

Architechture of Chrome Driver and chrome browser

How to launch Chrome browser in Selenium WebDriver?

Webdriver is the interface in API, which has several implementations. We mainly write test cases …

Leave a Reply

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