Step 1: Login to application and upload an image for Admin profile.
Application uploads image successfully without been recorded in Jmeter.
Step 2 : Start Jmeter, add a thread group.
Step 3 : Add HTTP(S) test script recorder, go to HTTP sampler settings and
select type as "Java".
Step 3: Select target controller as Thread Group, configure Firefox to port
8080 and start the test script recorder to upload the image.
Result: Application fails to upload image successfully when script is recorded
by Jmeter.
Error displayed is :"java.io.FileNotFoundException: My image.jpg (The system cannot find the file specified)"
How to upload image successfully with Jmeter?
For successful image upload recording the image needs to be in the JMeter's working directory - usually /bin folder of your JMeter installation so copy your image there and retry.
If it doesn't help - look for the following lines in jmeter.log file
jmeter.JMeter: JMeterHome=D:\jmeter\bin
jmeter.JMeter: user.dir =D:\jmeter\bin
it will allow you to determine the correct location for the image.
For more information on the subject check out Performance testing: Upload and Download Scenarios with Apache JMeter guide.