Work with the SQL editor
The SQL editor allows you to manage and test the SQL queries that fetch data during test runs. That way, you can ensure that your SQL queries fetch the information you want without having to run a test case.
Access the SQL editor
You can access the SQL editor from the SQL Statement test step in test cases you create with the following modules:
To access the SQL editor, follow either of these methods:
-
Hover over the SQL Statement test step and select
then
Edit SQL.
-
Select the checkbox on the SQL Statement test step and then
Edit SQL from the toolbar.
A new page opens where you can draft your SQL query.
Prepare an SQL query for your tests
In the SQL editor, follow these steps to prepare a query for your tests:
-
Enter your query in the SQL Query field.
The SQL editor supports test configuration parameters in your queries. Turn on Translate to see your parameters as the values they generate during test runs. Note that Translate only changes how you view your query, not its contents.
-
Optionally, select Run SQL to test run your query. Note the following:
-
The SQL editor uses a Data Integrity connection the query your data. If you haven't selected a connection, go back to your test case and fill in the value of the Connection test step.
-
This can return up to 1,000 rows of your SQL query results. Check these results to make sure your query fetches the data you want.
-
If your SQL query runs too long, you can select Cancel to stop the test run and improve your query.
-
-
Select Add to test step to copy your query in the test step value.
-
Select
or a test step from the breadcrumbs to continue building your test case.
What's next
Check out Tosca Cloud's database modules and Data Integrity modules to learn about the different tests you can run on your data sets.