Reputation: 63
I have recorded a workflow in Jmeter using Recording controller. In that workflow, a URL parameter 'member_id' get generated and appear in URL. This 'member_id' is getting used further in the workflow.
In the recorded script, value of 'member_id' is saved in a variable. Screenshot
Here the problem is; When I execute the scripts, then instead of newly generated 'member_id', the saved value is getting used in the later samples. I want to fetch the new value and update the saved value, so that it can be used in later samples
I have tried to fix this issue by fetching the 'member_id' from the URL and save it in a variable
I have tried 'Regular Expression Extractor' but I am not able to read the value. Screenshot
But when I print the response, I am getting only first digit of new 'member_id'. Screenshot
Upvotes: 0
Views: 587
Reputation: 168157
You're using wrong regular expression, it stops whenever it finds the first match
According to the JMeter documentation on Regular Expressions:
(
and)
these enclose the portion of the match string to be returned
.
match any character
+
one or more times
?
don't be greedy, i.e. stop when first match succeeds
So the solution will be to remove the question mark from your regular expression:
member_id=(.+)
or even better, if you're looking for numbers you should limit your search criteria to digits only like:
member_id=(\d+)
References:
Upvotes: 0