I have created a script in JMeter to download a file and now I have to get the name of the downloaded file [filename] from sampler response to store it in a csv file, I have tried to configure the sampler response but it didn't help me out. please see the following
Response headers:
HTTP/1.1 200 OK
Cache-Control: private
Pragma: no-cache
Content-Length: 1235270
Content-Type: application/octet-stream
Expires: Mon, 20 Apr 2015 12:10:35 GMT
Server: Microsoft-IIS/6.0
content-disposition: attachment; **filename="10098_testcase_package.pct**"
If you need to get "filename" bit from response header you can use Regular Expression Extractor post processor for it
Configure it as follows:
Response Headers
. It matters as by default the Extractor looks up in the response body and you need the header.filename
filename="(.+?)"
$1$
Other fileds may be left blank
You can refer extracted value as ${filename}
where required.
For more information on correlation in JMeter check out Using RegEx (Regular Expression Extractor) with JMeter guide.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments