Selenium Webdriver Intro

Selenium Webdriver and automated browser testing.

Selenium Webdriver employed to use a particular language in creating automated testing for a given browser. Image courtesy of Edureka.

Selenium Webdriver is a web framework from Selenium, an open source project containing several utilities for browser automation. Selenium produces a variety of softwares that act as emulators for users to interact with various browser interfaces.

Webdriver specifically allows its users to carry out automated tests written with a chosen language like Javascript, Python or Ruby, to ensure that their programs are working for their users as expected within a given browser.

Architecture

Selenium Webdriver is comprised of four parts:

  1. Language Bindings: Selenium supports many client libraries — Ruby, Python, Javascript, etc — These “language bindings” ensure the compatibility of multiple languages in writing the code that composes automated tests. All possible language bindings are available for download here.
  2. JSON Wire Protocol: JSON (meaning “JavaScript Object Notation”) is essentially a format for transferring data from client to server. It is readable and writeable for humans, and easy to parse for the machines they interact with. The JSON Wire Protocol is essentially an instance of JSON specifically for automation — what a user interacts with in the browser is mapped according to RESTful methods in the request/response cycle.
  3. Browser Drivers: Selenium has a driver for any given browser that requests, receives and executes a given task using Selenium commands via an HTTP server. The driver used is also specific to the language one is using to write the tests.
  4. Browsers: Like language bindings, Selenium also offers compatibility for numerous web browsers like Chrome, Firefox, Safari and others.

Functionality

When working with Selenium Webdriver, the following things occur:

  • Code for automated tests are converted from a given compatible language into an HTTP request using the JSON Wire Protocol described above.
  • Whichever browser being tested activates its particular driver through Selenium and starts the server.
  • The browser processes the request.

God willing, I’ll have a tutorial for implementation and set up using JavaScript and VSCode to implement automated tests next week! Stay tuned and thanks for reading.

Further Reading and Sources

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sam Hall

Sam Hall

Full stack developer and stand-up comic.