Book Image

SoapUI Cookbook

By : Rupert Anderson
Book Image

SoapUI Cookbook

By: Rupert Anderson

Overview of this book

Table of Contents (19 chapters)
SoapUI Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Parameterizing SQL queries with the JDBC Request TestStep


This recipe builds directly on the last one to show how the JDBC Request TestStep can be used to execute parameterized SQL queries based on property values from outside the TestStep. This can be useful, as it allows the JDBC Request TestStep to query and check data based on properties set from the results of other TestSteps, for example, executing a query using an ID obtained from a web service response.

How to do it...

First, we add a new parameter with a fixed value to the JDBC Request TestStep and use it as the criteria for a simple select query. Then, we change the JDBC Request TestStep parameter to take its value from the value of a TestCase property. Perform the following steps:

  1. Edit the JDBC Request TestStep from the previous recipe and add a new parameter called invoiceIdParam with a value of 2.

  2. Then, modify the SQL Query value to add a where clause to specify that the invoice id field must be equal to the value of invoiceIdParam...