0
votes

am using JMeter 4.0 and I have been trying to parameterize the filename in "Attach files" option with no success. I am required to use attachments of varying sizes and with each loop a random pdf file (from the set of files saved locally in d drive) to be attached with the email.

I am using a CSV data set config for parameterization and see no issues in using the parameters in Subject line of within the Message.

However, when used with the attach files option, the JMeter test fails to execute with FileNotFoundException as the variable name is substituted as such instead of the pdf filename. Is there a solution?

Error Message: java.io.FileNotFoundException: D:\Data_Jmeter\${AttachFile}.pdf (The system cannot find the file specified)

1

1 Answers

0
votes

I cannot reproduce your problem using the following settings:

JMeter SMTP Sampler Attach File

Where ${path} is set via User Defined Variables on Test Plan level and resolves into "bin" folder of my JMeter installation

The same situation for ${path} variable originating from the CSV Data Set Config

So I would recommend to double check if your ${AttachFile} variable is defined, you can do this using Debug Sampler and View Results Tree listener combination