logo logo

API Test Automation Flows Combined with Database Flows

API Test Automation Flows Combined with Database Flows

End-to-end API testing flows can involve multiple input sources, such as HTML, Databases, Telnet/SSH, Mobile, Shell, Data files, other RESTful APIs and more. TestProject‘s test automation platform allows not only testing your APIs manually, but also to complete end-to-end API based test automation flows, schedule and run them periodically, get execution reports and all of that without any third party tools and without a single line of code πŸš€

This hands-on tutorial consists of step-by-step examples and real automated test flows, shared here for you to use and practice while automating your APIs. In this chapter (Chapter #3), we will walk through API test automation flows combined with database flows. You can access the test mentioned in the example below by using the following shared test link: API Database Test.

Table of Contents – Automating End to End API Testing Flows

  1. Overview – Automating End to End API Testing Flows
  2. Chapter 1 – Basic API Test Automation
  3. Chapter 2 – API Test Automation Flows Combined with Mobile Functional Test
  4. You’re here β†’Β Chapter 3 – API Test Automation Flows Combined with Database Flows
  5. Chapter 4 – API Test Automation with Combination of Shell Commands and Local Files
  6. Chapter 5 – Advanced API Test Automation and Validation Flows
  7. Chapter 6 – Scheduling API Automation Flows and CI/CD Execution

Multiple Database and API Test Example

TestProject allows you to test your connection and query many kinds of databases, including: Oracle Database, Teradata Database, MySQL Database and more. They can all be found in the Addons Library:

TestProject Database Addons

Each Addon contains two actions to the appropriate database:

  1. Test SQL Connection
  2. Send SQL Query

The following example will show how to test a connection to an Oracle Database, by inserting the database IP, port, username, password and service name:

Multiple Database and API Test Example

Multiple Database and API Test Example

After running the test step, we can see the connection has been successfully established:

Multiple Database and API Test Example - Established Connection

You can use the ability to connect and query databases in your API tests, to perform dynamic queries based on the API responses and validations.

The following example will send a query to create a new table with data extracted from an API request:

dynamic queries based on the API responses and validations

dynamic queries based on the API responses and validations

The following table will be created:

dynamic queries based on the API responses and validations

Afterward, we will perform an HTTP Get request to receive a response and store it into a parameter:

dynamic queries based on the API responses and validations

dynamic queries based on the API responses and validations

From the response, we will extract multiple JsonPaths and store them in parameters:

dynamic queries based on the API responses and validations

dynamic queries based on the API responses and validations

And then create a dynamic query to insert the data into our Oracle Database table:

dynamic queries based on the API responses and validations

We will see the results updated in our table after execution:

dynamic queries based on the API responses and validations

πŸ‘©β€πŸ’» TAKE ME TO CHAPTER #4 πŸ‘©β€πŸ’»

About the author

David Goichman

Automation has been a great passion of mine from day one. Software Engineer at TestProject.

Leave a Reply

FacebookLinkedInTwitterEmail