Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Db tool validation

sachin
sachin Posts: 18

We are running 50 soap services and each soap service is generating the transaction id so is there any way to collect all the transaction id and use db tool to validate the transaction.

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,316 ✭✭✭
    edited January 28

    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
    
  • benken_parasoft
    benken_parasoft Posts: 1,316 ✭✭✭