-2

i am new to jmeter and i am using regular expression extractor to extract document number which is between

<showDocument> 834446$$$$1601Consent </showDocument>

which field should i check Body or Response Header

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
Curious123
  • 11
  • 2
  • is that xml? then regexes are exactly the WRONG thing to use... – Marc B Jan 13 '16 at 21:20
  • i don't know jmeter but i guess that this is an XML: [Why you are wrong](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags) – Stefano Saitta Jan 13 '16 at 21:21

1 Answers1

1

The relevant Regular Expression Configuration would be:

  • Reference Name: anything meaningful, i.e. showDocument
  • Regular Expression: <showDocument>(.+?)</showDocument>
  • Template: $1$

Regex Tester

You can access extracted value as ${showDocument} where required. See Regular Expressions chapter of JMeter User Manual for more details

By the way, your response part looks like XML so it might be easier and better to consider using XPath Extractor instead. In that case XPath Tutorial would be extremely helpful.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133