Adding an SQL Query action to a test
Before you begin
Ensure that the database resource is properly configured in the Architecture School perspective. For more information about configuring a database resource, see Database resources, connections, and bindings.
You must have a test. For more information about creating tests, see Test Factory. Tests include steps and actions. For more information about test steps and actions, see Actions in a test step.
Selecting a test
Procedure
Adding an SQL SELECT statement
About this task
To return results against the selected database, add an SQL SELECT statement. Data that is returned from the query can be validated once it is retrieved.
Procedure
Testing an SQL SELECT statement
About this task
Before you run the SQL SELECT statement against a selected database, it might be a good idea to test the SQL SELECT statement.
Procedure
Editing the query results or manually adding data
About this task
If you did not run a test query and save the results, you can add data from the Assert tab or Store tab, by using the following icons.
If you ran a test query and saved the results, the column headings (and data) are displayed in the Assert tab and Store tab, and the rows, columns, and cells can be edited and arranged by using these same icons above the data. To see what an icon does, hover over it.
Procedure
- Select any row and append a row to it, insert a row after it, or delete the selected row. You can also move the selected row up or down.
- Select any column and append a column to it, insert a column after it, or delete the selected column. You can also move the selected column left or right.
- To clear all the data, click Clear Expected Results ().
Validating query results
About this task
To change the validation rules for a cell or column, use the Assert tab. For example, you might want to validate a set of query results against general criteria instead of specifying exact values to match.
Procedure
Storing the return value in to a tag
About this task
You can store the values in a tag, either as a list or as a single value. When you edit a column, all the values for that column are stored in the specified tag as a tag list. When you edit a cell, a single value for that cell is stored in the specified tag. For more information about storing data in to a tag, see The Field Editor.
To store the values for a column or the value for a cell in a tag for later use, use the Store tab. For example, you might want to set the value of the tags in the test to the values of each column in the data source.