Forum Discussion
PaulMS
7 years agoSuper Contributor
An example comparing selected columns from DB query
Add a script assertion in the JDBC request step to set the property values
import com.eviware.soapui.support.XmlHolder holder = new XmlHolder( messageExchange.getResponseContent() )
context.testCase.setPropertyValue( "Array IDs", holder["//Row/ID"].toString() ) context.testCase.setPropertyValue( "Array Names", holder["//Row/NAME"].toString() )
Then use JSONPath Match assertions
(in this case I converted ID to lower case to match the response)
JSONPath Expression $..Id
Expected Result ${="${#TestCase#Array IDs}".toLowerCase()}
JSONPath Expression $..Name
Expected Result ${#TestCase#Array Names}
Related Content
- 2 years agojerry91