What is Selenium WebDriver?
The official site says that
Selenium automates browsers. That's it!
What you do with that power is entirely up to you.
Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that.
Boring web-based administration tasks can (and should) also be automated as well.
Is there an easier way of understanding what Selenium test automation is?
Can test automation with Selenium WebDriver be explained in simple terms so that everyone can understand it?
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 don’t 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
What happens while driving a taxi?
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
browser
What happens during test automation?
Dialogue between the 3 actors involved.
How do the analogy between taxi driving and web driver test automation work?
Let's see:
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
and makes decisions based on it.
The browser executes the commands received from the browser driver.
Is the analogy clear now?
Very well compared and explained. Thanks 😀