The official site says that
WebDriver is a tool for automating web application testing, and in particular to verify that they work as expected.Testers with only manual testing experience might have questions about this definition.
It aims to provide a friendly API that’s easy to explore and understand, easier to use than the Selenium-RC (1.0) API, which will help to make your tests easier to read and maintain.
It’s not tied to any particular test framework, so it can be used equally well in a unit testing or from a plain old “main” method.
What is a framework?
What is an API?
How does Selenium-RC works?
What is unit testing?
Too many questions instead of an answer.
Is there an easier way of understanding what WebDriver test automation is?
Can test automation with Selenium WebDriver be explained in very simple terms so that everyone can understand it, even without having any technical knowledge?
An easy way of explaining how a new thing works is through an analogy with something else that you already know.
The WebDriver name points to the analogy.
Everyone knows what a driver is and what it does.
Many people drive a car.
Those who dont drive a car use the services of taxi drivers.
Who participates in taxi driving?
3 actors are involved:
- the customer
- the taxi driver
- the car
Dialogues between the 3 actors involved.
So this is the analogy to use to explain test automation with WebDriver.
Test automation with WebDriver is like driving a taxi.
It happens through dialogues between the 3 actors involved.
Lets have a closer look at taxi driving.
A customer gets into a cab.
He gives instructions to the taxi driver about
- the address and
- the route to take
The cab driver drives the taxi, the car in this case.
While driving the taxi, the driver gives commands to the car using the wheel, pedals, etc.
The driver receives information about the cab’s status on the meters and makes decisions based on it.
The car executes the taxi driver commands to get to the desired address.
How does this help with understanding test automation?
Let's ask about test automation the same questions asked for driving a taxi.
Who participates in test automation?
There are 3 actors in test automation with WebDriver:
- tester that writes the automation code
- browser driver
Dialogue between the 3 actors involved.
How do the analogy between taxi driving and web driver test automation work?
A test engineer is like a taxi customer.
The test automation code is like the customer instructions to the taxi driver.
The browser driver object is like the taxi driver.
The browser is like a car.
Does it start making sense?
Taxi driving versus test automation?
Let's have a closer look at test automation.
The test engineer writes code with instructions for the browser driver object.
He tells the browser driver object to
- open the site and
- interact with the site elements.
The browser driver drives the browser.
It does this by sending commands to the browser.
The browser driver receives information from the browser about
- status of site elements (are they visible, are they enabled)
- values of site elements
The browser executes the commands received from the browser driver.
Is the analogy clear now?