You can parameterize tests (for data-driven testing) by extracting values from one test and then using them available in another test. This is accomplished with tools such as:
- XML Data Bank
- Header Data Bank
- JSON Data Bank
- Text Data Bank
- Writable data sources (described in Configuring a Writable Data Source)
For example, if you wanted to parameterize one of test 3’s request value with the id value from test 1’s response, you would set that field to Parameterized....
then use the data source wizard to indicate which element’s value you want to use. You could also manually configure values to be stored to a data bank or writable data source, then parameterize the response vs. those saved responses.
In addition to this tool-to-tool value passing, values can also be passed in the following ways:
- Through variables: Variables can used to parameterize all or parts of text field values in tool editors. For example, a text field could reference environment variables, a data source column, a data bank column, or a variable defined for the current suite. For details, see Parameterizing Tools with Variables.
- Through scripting: This is primarily used when you need to pass an object of a type other than a String. You can only access these values through scripting. This is done using com.parasoft.api.Context get(String) and put(String, Object). For details, see Extensibility and Scripting Basics.