How to get API response XML values in to variables in Jmeter tool? see bold color values. my plan is to assign those variables in to response assertion> 'pattern to test' for match with DB values(using Jmeter variable which comes in JDBC Response).
1 Answer 1
Extract the value from XML using XPath Extractor, the relevant XPath query would be something like
//Product/Id/text()
Once done you will be able to compare 2 JMeter Variables:
- the one from the XPath Extractor
with the one from the JDBC Request sampler
using Response Assertion configured like:
- Apply to ->
JMeter Variable
-> Reference name, used in the XPath Extractor (NB: don't surround the variable with${}
, just put plain text there - Pattern Matching Rules:
Equals
Patterns to Test: variable from the JDBC Request (NB this time you need to surround it with
${}
, for example${ID_1}
- Apply to ->