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
- Overview β Automating End to End API Testing Flows
- Chapter 1 β Basic API Test Automation
- Chapter 2 β API Test Automation Flows Combined with Mobile Functional Test
- Youβre here βΒ Chapter 3 β API Test Automation Flows Combined with Database Flows
- Chapter 4Β βΒ API Test Automation with Combination of Shell Commands and Local Files
- Chapter 5Β βΒ Advanced API Test Automation and Validation Flows
- 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:
Each Addon contains two actions to the appropriate database:
- Test SQL Connection
- 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:
After running the test step, we can see the connection has been successfully established:
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:
The following table will be created:
Afterward, we will perform an HTTP Get request to receive a response and store it into a parameter:
From the response, we will extract multiple JsonPaths and store them in parameters:
And then create a dynamic query to insert the data into our Oracle Database table:
We will see the results updated in our table after execution: