Queries
Run queries against any data source in CAT Studio.
On this page
On Queries tab, you can run any query against any data source you defined. The page has two use-cases.
Playground
You can use queries tab as a playground, where you issue queries against your data sources and check the data you are about to test. You can give your queries names and descriptions. A name already used by another query, in any case, is refused.
Once you want to turn one of your queries into an automated test, you can use “Make it a Test” button. You then just set correct expectation, fill name, description and categorization for the test, and you are done with automation.
Metadata for Tests
CAT supports generating test from metadata. This is a huge time-saver. On Queries tab, you define the metadata query that should be used for generating tests. Add a query, give it a name and then on Tests page, create a test and set “Metadata” to your query.

You can then anywhere use syntax %NAME_OF_ONE_OF_COLUMNS_RETURNED_BY_THE_QUERY% - CAT will automatically create a test for each row and replace these placeholders with values from the query results.
Entered Data
A query does not need a data source of your own. Pick Entered data, the last item of the data source dropdown, and a grid takes the place of the editor and of the results: type or paste the rows, and each edit writes them into the query as a short text. Run Query is off for such a query, since the rows are the query. Everything about the grid is described on the Tests page, see Entered Data.
Such a query can feed a test template too: give it a name, list the values a template should go through, and set it as the template’s “Metadata”.
Page Structure

- Query Toolbar
- Common actions, like run a query, duplicate a query etc.
- Query Tabs
- Switch between open queries, add a new query.
- Query Editor
- Type or paste your query. No advanced intellisense or query formatting is available at the moment.
F1reveals common actions for working with text (comment, upper-case, lower-case etc.). - Query Details
- Here you set against what data source should the query be run, name of the query and description.
- Query Results
- The results of your query. You can use advanced grid features - right click any column header to see options you have. Remember the query results are kept in memory - the editor is not yet designed to work with millions of rows. Tip: you can save your project and reload it - this way you get rid of any datasets you don’t work with. The results area also contains Messages tab, if the query returns any messages (such as
printin MS SQL server) or errors. - Status Bar
- Statistics about the query run, such as number of returned rows.