2

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).

enter image description here

enter image description here enter image description here

asked May 19, 2017 at 10:00

1 Answer 1

2
  1. Extract the value from XML using XPath Extractor, the relevant XPath query would be something like //Product/Id/text()

    JMeter XPath Extractor Demo

  2. 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}

        JMeter Response Assertion on Variable

answered May 19, 2017 at 11:06
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.