Search code examples
urldynamicjmeterpreprocessorcapture

JMeter: How can I capture the variable value which is dynamic in url?


We have a URL https://www.mylink.com/est?myId=4d22b9d0-4ff2-46c3-9343-945304dfea93

The above request also contains post data:

myId=4d22b9d0-4ff2-46c3-9343-945304dfea93

How can I parameterize this as the url and post data both contain same value but its dynamic. Also, how may I store it in a variable to use it somewhere else as well?


Solution

  • In order to be able to use it in URL and request body you need to extract it somewhere somehow, this dynamic ID is probably associated with this or that user account so my expectation is that after logging in you should see this ID somewhere in the response.

    The process is known as correlation and there is a plenty of information over the web about handling dynamic requests in JMeter. There are also solutions which provide semi or fully automated correlation of the dynamic parameters like Correlations Recorder Plugin for JMeter or JMeter Proxy Recorder

    If you just need to generate an unique GUID-like structure - you can do it using __UUID() function