Database Testing Using Selenium WebDriver and JDBC API

Updated 12 August 2021

Facebook Linkedin

In our last Selenium blogs  we learned below Some Selenium frameworks Concepts:

We discussed some Advanced concepts like how we deal with Data Manipulation in Excel sheet by Selenium WebDriver. So moving ahead with our advance topics of selenium blog series we will introduce you with concepts of Database Testing using Selenium WebDriver.

We would discuss the basic process like Database Connection, executing queries, fetching data and disconnecting database instances etc. As we know that all the web applications need a backend to store the Data. Databases like MySQL, oracle, and SQL server are popularly use in these days

Here I take a example of Bookingcommerce in which i explain how user can register in bookingcommerce.com  , So Bookingcommerce is basically a Saas based  online booking and Appointment scheduling software.

Consider a following scenarios

1) In any application we make sure that the data entered by code is consistently reflected in our databases. Thus we are able to retrieve the information by executing a sql query and verify the retrieved information against information we pass in our application by code. for examples,  registration forms, user data, user profiles, and delete user data. Thus after Running our registered user Test code we need to make sure that whatever information we pass by Test code will get successfully saved into the Database as soon as user registered in our application.

2) Another use case of performing database testing with Selenium WebDriver by building mysql connection either with our localhost and either with another system IP.

Below  Code with mention all scenarios  for User Register in Bookingcommerce.com


Below is my Excel sheet :






. . .

Leave a Comment

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

Be the first to comment.