| || |
Is there a way to compare XML responses?
Is there a way to compare XML responses in JMETER?
Scenario: I want to run 2 similiar XML requests and then
compare the two responses to see if they match.
However, there may be a few elements in each response that
I want to skip--like and OrderID or TimeStamp.
But overall-- I'd want to make sure the rest of the responses--which may contain hundreds of elements and attributes-- matches up.
I might use this to regression test in two different environments to test a change.
Re: Is there a way to compare XML responses?
Jmeter doesn't have a clean way to do this when it doesn't match 100%.
Since you want to skip some elements, I would write the response out as external files and then use a file compare utility that highlights the differences. I use docDiff or the online tool "Quick Diff".
If it DID match 100%, you could do a regex, save the entire response to a variable, then do an assertion on the 2nd request stating "Must contain regex value". Structure:
-- Regex A
-- Assertion "contains Regex A"