Categories: Uncategorized

by Jerome Josephraj


While automating Behavior Driven Development, automating Database operations and asserting Database Results is extremely easy using NoCodeBDD. All you have to do is, define your feature file using Gherkin language, add Database Connection, provide your SQL and define the values to Assert. Let’s look at how it is done step by step

Feature File

For the purpose of this blog, let’s assume the following Feature file
“When Database is called to check the User with userid as “U001” “
“Then the Firstname should have value “Joe” and Lastname should have value “Doe” ”

Step Definition

For the above Step, create a Step Definition and select “Run SQL Query” option, before asserting DB results, we need to provide the DB SQL to get the result. Following sections show how it is done

Create DB Connection

In DB connection page, select a connection before you add a SQL. Adding a connection is straight forward. The connection configuration is similar to any DB client. All you need to do is provide a connection name, which can be any name. The DB server host name or IP, Database name, Database Type, Port number and Username and Password. If Password is not required, leave it empty. Following GIF shows how a DB connection is added:

Add SQL without writing any code

Once a Database Connection is added, provide a SQL as shown in GIF below

Assert SQL values without writing any code

Once you have defined your DB connection and provided the SQL to fetch the results, you can assert by selecting “Assert SQL Response” and select Single Row, which is selected by default. Then enter the column name that needs to be asserted that’s “Firstname” and the value as “Joe”. Add another row and enter column name as “Lastname” and value as “Doe” and press Save. This is shown in GIF below:

Check Results

To check the results, simply press Run and press play button. This will run the added Step Definitions and you can view the details by pressing “i” button next to step. This is shown in the GIF below:

The above shows how easy it is to validate DB results using NoCodeBDD, without having to write any code. Most importantly, there is no code to maintain. NoCodeBDD, basic version, is free to use. Feel free to download it from and automate your BDDs in minutes.


Subscribe to our free newsletter.

Related Posts

View all

  • Continue reading
  • With NoCodeBDD, teams can automate Behavior-Driven Development (BDD) Scenarios for mobile applications with few clicks. To create test automation for mobile scenarios, typically, one would use Appium. Using NoCodeBDD, all you have to do is: Following gif shows how this is done for a sample mobile application: NoCodeBDD Mobile Automation NoCodeBDD […]

    Continue reading
  • if("student".equals(userType)){ Assert.assertEquals("STUDENT REGISTERED SUCCESSFULLY",actualMsg); }else{ Assert.assertEquals("ALUMNI REGISTERED SUCCESSFULLY",actualMsg); } When you have test code written like that given above—or. in other words, the code is written to assert an outcome based on conditional logic—it won’t test the scenario as it should. When writing test automation code for behavior-driven development (BDD) […]

    Continue reading
  • There is a general mis-conception that BDD should be used for testing. Many projects consider using BDD during “Testing phase” and only the QA team uses BDD. When BDD is rolled out this way, the teams don’t see the benefits. In this short video, I have explained how Behavior Driven […]

    Continue reading