Run database query, add validations, and extract values
Learn how to connect to database and run SQL queries in Low Code Automation to validate data and extract dynamic values.
This feature lets you connect and query your databases directly in Low Code Automation. There is no extra backend setup needed outside the Low Code Automation platform. You can effortlessly run SQL queries within your automated tests, validate backend data in real-time, and extract dynamic test data. This eliminates the need for extra handling and streamlines your testing process.
Supported databases
Low Code Automation currently allows connections to the following databases:
- MySQL
- PostgreSQL
Currently, only connections to public databases are supported.
Configure a new database connection
To execute a database query while recording a test, you need to first set up a connection between Low Code Automation and your existing database.
- On the recorder, click the ︙ icon and click Run database query.
- In the Connect database section, select the database type.
- Alternatively, click + Add new connection.
- In the New database connection window, provide the following details:
- Database type: Select the type of database you want to connect to. Currently supported: MySQL and PostgreSQL.
- Connection name: Enter a name to identify this database connection.
- Test description (Optional): Add a description to help you or your team understand the purpose of this connection. For example, Test environment for login module.
- Hostname: Enter the hostname or IP address of your database server.
- Port: Specify the port number used to connect to the database.
- Database name: Enter the name of the database you want to connect to.
- Username: Provide the username with access to the database.
-
Password (Optional): Enter the corresponding password for the username provided.
- Click Test & connect. This verifies the connection details you’ve entered. If the connection is successful, your database will be linked to Low Code Automation and ready for use in your tests. To run the query, refer to the Run a database query section.
- Another way to configure a database connection is through the Database section. In the left pane, expand Data configuration and click Database. Then, click +Create new connection and follow the same steps as previously described.
Run a database query
Once the connection between Low Code Automation and your database server is successfully established, you can run queries during test recording.
- In the recorder, click the ︙ icon and select Run database query.
- Under the Connect database section, click Connect next to the database you wish to connect to.
- Enter the query you want to execute and click Run Query.
The results are fetched and appear in a table format. - You can then add validations or extract values from these results as needed. Additionally, you have the option to import variables if required by clicking the + Import variable option.
Users should be able to select an existing database connection and execute SQL queries on that database. There are no built-in restrictions to block write operations in SQL queries. Please ensure the connection is configured with a user that has the required access controls.
Manage database connections
To view and manage your database connections in Low Code Automation:
- Navigate to Data configuration > Database. It displays all the database servers connected to your Low Code Automation account. The list shows the database name, the tests linked to each connection, and information on when and by whom it was last updated.
- Click the ︙ icon next to the database connection to perform one of the following actions:
- Edit connection: You can modify the connection details. Note that editing a connection affects all tests linked to it.
-
Delete connection: You can remove a connection only if it is not linked to any tests.
Points to remember
- Query results are limited to a maximum of 100 rows and 40 columns.
- A single test can be connected to multiple databases.
- When using database calls in high-concurrency scenarios such as data-driven testing, ensure that the database can support the expected connection load.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!