To handle the dynamic time stamp and activity ID in the download file sampler in JMeter, you can use the following steps:
- Add a Regular Expression Extractor to the request which generates the URL with dynamic values (e.g. activityId, timestamps).
- Extract the dynamic values using Regular Expression Extractor and store them as variables.
- Use the variables in the download file request, e.g.
- Make sure to check "Use caching" option to cache the binary content.
- Add the necessary headers and parameters in the download file request if needed.
Note: Make sure the Regular Expression Extractor is applied to the correct request and it successfully extracts the values.
Ass you mentioned in the comment the file name is generated dynamically.
In this scenario, you can use a Correlation Extractor in JMeter to dynamically extract the file name from the response of the download request. Here are the steps to do this:
- Add a Correlation Extractor to the request where the file download is initiated.
- In the Correlation Extractor, specify the regular expression that matches the autogenerated file name in the response.
- Store the extracted file name as a variable, e.g.
- Use the extracted variable
fileName in the file download request, e.g.
Note: Make sure the Correlation Extractor is applied to the correct response and it successfully extracts the file name. You may also need to adjust the regular expression as needed to correctly match the file name.