0

When I recorded the script for downloading a CSV file, only that HTTP request is getting a 400 response code. The audit history of the website displaying file is downloaded. When I hit the audit history download link, I get an internal server error.

Note: if I download the file with manual steps, the audit history download link is downloading the CSV file.

My payload has dynamic time stamps for file name suffix and activity Id

fileName: 
AAJCAA_5199_1312023_73446PM.pdf
activityId: 
87061

Please let me know how can I declare these parameters in the download file sampler.

2 Answers 2

1

Most probably it's a matter of correlation, i.e. these file name and activityId are somewhere in the previous responses and you need to extract them using a suitable JMeter Post-Processor and replace hard-coded values with the JMeter Variables from the Post-Processor.

In case if timestamp is the current timestamp - you can use JMeter's __time() function to generate it on the fly like:

${__time(ddMMyy-hmmssa,)}

enter image description here

1
  • I found the activityId in the previous request but not the file name. File name is autogenerated when the download action is completed. then how can i correlate the file name in regex? Commented Feb 2, 2023 at 0:50
-1

While working in a software qa consulting organization, I've tackled with several issues working with JMeter. Considering the above issue, there may be two different cases that can be considered.

Case-1

As per the response code, it seems that the issue is with the request in the script. Several factors are needed to be checked such as :

  • parameter
  • url
  • path of the given location
  • connection (required to check with sever/network team: if the application is subjeted to allow request from an external source)
  • authentication (if any)

Other solutions include:

  • try to record with blazemeter
  • if you have acccess you can use other licensed tools
  • try to use latest version of jmeter (apache-jmeter 5.5)

Case-2

As far as the file name and activity_ID is considered, it may be:

  1. Co-relation : As far as the file name and activity_ID is considered, both the file name and activityId may be found in the previous responses and you need to extract them and pass them using regular expression over hard-coded values.

  2. Timestamp : if in case the filename may be generated using the current time stamp, then the time-stamp regular expression can be used ${__time(ddMyyyy_hmmssa,)}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.