Db tool validation
Comments
-
To validate a transaction ID you first need to extract it. Extractions are typically done by chaining a Data Bank tool to the test that provides the value. In the Data Bank, you would specify a custom column name like "transaction_id". In your DB Tool, you can reference this column directly in your SQL query as "${transaction_id}". For example, your SQL query could look something like "SELECT id FROM transactions where id=${transaction_id}".
You can validate each transaction ID you extract this way. However, if you must accumulate a list of values then you would typically use a Writable Data Source. Instead of configuring your Data Bank to write to a custom column you configure it to write to a Writable Data Source column. The Writable Data Source column can similarly be named "transaction_id". The DB Tool just needs to be added to a separate suite, following the first suite that is writing to the data source. This second suite acts as a context for iterating over the row data.
Single:
Test Suite: SOAP Client > Data Bank DB Tool
Multiple:
Test Suite: Data Source: Writable Nested Suite - adds rows to Writable data source SOAP Client > Data Bank SOAP Client > Data Bank SOAP Client > Data Bank ... Nested Suite - reads rows from Writable data source DB Tool
0 -
Another resource in case it helps:
How to Assert Service Response Values against a Database0