

Using CA Application Test › Using the Workstation and Console with CA Application Test › Building Test Cases › Assertions › Add an Assertion › Add an Assertion from a JDBC Result Set
Add an Assertion from a JDBC Result Set
When you have access to the Result Set response from a JDBC step, you can use the response to add an assertion directly. The following example shows how to add an assertion in this way.
Here is an example for a result set response, using the response of Verify User Added step in multi-tier-combo test case in the examples directory (multi-tier-combo.tst).
Follow these steps:
- Select the Verify User Added step, and double-click it to open its editor window. Edit the SQL statement so it reads select * from users.

- To run the query, click the Test/Execute SQL button.
- Select the Result Set tab and click the cell in the result set that represents the information that you want to test for (for example, sbellum).

- Click
Generate Assertions for the Value of a Cell in the toolbar below the Result set window.
We want to test that sbellum appears in a cell in the LOGIN column.
- In the Generate JDBC Result Set Value Assertion dialog, enter the test step (fail) to redirect if the value is not found:

DevTest creates an assertion with the name Ensure JDBC Result Set Contains Expression in the Verify User Added step.

Note: The same assertion capabilities are available when a JDBC result set is displayed in the step editor.
Copyright © 2014 CA Technologies.
All rights reserved.
 
|
|