Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

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.

  1. On the recorder, click the icon and click Run database query. Click the run database query button
  2. In the Connect database section, select the database type. Click the database type
  3. Alternatively, click + Add new connection.
  4. 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. Enter the database details to establish a connection
  5. 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. Database is successfully connected to Low Code Automation
  6. 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. Add a new database connection to Low Code Automation

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.

  1. In the recorder, click the icon and select Run database query.
  2. Under the Connect database section, click Connect next to the database you wish to connect to. Connect the database
  3. Enter the query you want to execute and click Run Query.
    Enter the query you want to execute
    The results are fetched and appear in a table format. Recorder panel displays the search results
  4. 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:

  1. 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.
    View list of all database connections
  2. 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. Click the three dots icon to edit or delete a database connection

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





Thank you for your valuable feedback

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle