0
votes

I am using regular expression extractor in JMeter to extract the response data, in which contains something like the following:

<ns5:someID>803268d0-e828-11e3-881a-842b2b2d2432</ns5:someID>

I would like to extract the 803268d0-e828-11e3-881a-842b2b2d2432 part out of the response data, and I know there's only going to be one such tag and one such ID in the response. The ID format is always going to be that way, alphanumeric and dashes, the same length and the character length is always 8-4-4-4-12.

I tried to set up regular expression extractor with the following setup:

Apply to: JMeter Variable (someID)
Response field to check: Body
Reference Name: someID
Regular Expression: <ns5:someID>([^"]+?)</ns5:someID>
Template: $1$
Match No.: 1
Default Value: ERROR

But it's actually returning the default value "ERROR" every single time. I wonder if I've done anything wrong. Can anyone help? Thanks!

1

1 Answers

0
votes

Your regular expression is working, ensure that the regex extractor is a child of the sampler and the XML namespace (ns5:) is printed in the text response body of the sampler.