0

Option value = "Active" select = selected

This is the syntax of the regex

In request body

There are 12 values in regex. I have to extract all values and passing those value to respective request body

I need to pass Account number: ${csv_accno}

Value1 : 12 th occurrence

Value2 : 11 th occurrence

Value3: 8 th occurrence

Value4: 7th occurrence

Value5: 4th occurrence

Value 6 : 5th occurrence

Value7 : 2nd occurrence

Value 8: 1st occurrence

PS: I have to pass all values in same request with respect to occurrence for all user accounts

Additional doubt: if dev team changed the html format it would be affect this script..

Could you please help to solve this issue...

1 Answers1

0
  1. First of all using regular expressions for parsing HTML is not the best idea, consider going for CSS Selector Extractor instead

  2. There is "Match No" setting which controls which "occurrence" will be stored into a JMeter Variable. If you put -1 there JMeter will get all "occurrences" and store them into variables like:

    occurrence_1=value1
    occurrence_2=value2
    ...
    occurrence_matchNr=the number of "occurrences"
    

    You can see what variables does your Post-Processor generate using Debug Sampler and View Results Tree listener combination

    enter image description here

So you should be able to pass the values as:

  • Value1: ${occurrence_12}
  • Value2: ${occurrence_11}
  • etc.

If response is changed the script will be "affected"

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks for your response. Can i use xpath extractor for correlation. When i write dynamic xpath script will affect in future.. – Prabhakaran D Mar 25 '23 at 10:32