0

I need to extract value from the response body text and need to add that value for another request. I need to write a regular expression to capture the below-mentioned value.

<id>45893943</id>
Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
Subodhya
  • 9
  • 4

1 Answers1

1

If you're looking for a regular expression - it would be something like <id>(\d+)</id> where:

  • d - matches any number
  • + - repetition

enter image description here

It might be easier for you to consider Boundary Extractor as it's configuration is more simple and it acts much faster, just provide <id> as the left boundary and </id> as the right boundary and JMeter will extract everything between the boundaries:

enter image description here

And last but not the least, using regular expressions for parsing HTML or XML is not the best idea, you might want to use CSS Selector Extractor or XPath Extractor instead, however we need to see the full response in order to be able to come up with the best solution

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • How can I add multiple tag values in single regular expression? For an example if the response have ID and ClientNo tags? – Subodhya Sep 29 '20 at 11:23