Answered question

I created a variable extractor and I would like to only get the last occurrence of all the extracted values.

I extracted all occurrences of a value but i'm only interested in the last one. I don't have any option to tell NeoLoad to only pick the last occurrence. Is there a workaround for that?

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team
Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

When you create a variable extractor to extract all occurrences of a value, NeoLoad will automatically create a variable “_matchNr” that will provide you the number of occurrences extracted.

For example, if your variable extractor name is ${MyExtractor}, ${MyExtractor_matchNr} will automatically be created. If the number of occurrences are 10, this variable will contain the value 10.

Moreover, if you would like to pick a specific occurrence of your value, you can use that syntax: ${MyExtractor_n}

For example; ${MyExtractor_3} is the third occurrence.

So if you would like to pick the last occurrence (without knowing in advance the number of occurrences you will get) you can use that variable syntax:


${MyExtractor_${MyExtractor_matchNr}}


Using the example above, that built variable will contain the 10th occurrence.

 

For more information, see “Variable extractors” under “Requests” section in NeoLoad

Did you find this useful ?

No (0)

Yes (1)

100%

100% of users found this answer useful