How can I pass dynamic value using regular expression in JMeter.
I need to pass the payment id from request to subsequent request.
Tried with that...But the default value only passing as shown in the image...
The primary way to pass the dynamic value in Performance Testing (using any tool) is through Correlation.
Correlation is extracting value from one of the requests which can be used in the subsequent request or any of the request which must be executed further.
Steps for correlating:
(1) Create a Test Plan- Either Template or Manual
(2) Add required listener, sampler, pre-processor, post-processor
(3) There might be an HTTP request with dynamic value -> highlighted (session-id, etc.)
(4) Add regular expression extractor to the request with required boundaries. Every dynamic value requires a set of Regular expression.
Ex: (.+?) . - is used for search (a-z) [0-9] + is used for repeatitive ? is used for -might or might not be under
These are the steps that will help you achieve Correlation in JMeter. Thanks for reading!!
You can use the Regular Expression Extractor.
You can simply select URL as Field to check and capture the end of the URL and place in a variable, which can be used afterwards.
Body
Change Regular Expression to be:
PaymentID=(\d+)"
Other settings look fine
More information: