lundi 13 juillet 2015

Jmeter image upload using record and play

I'm trying to upload/add image while recording the session, but i'm getting error

Undefined index: image_file_1

and i found the parameter name of the add image button through inspect element in firebug is below

<a class="btn btn-price select-file" href="javascript: void(0)">
add
<i class="fo"></i>
</a>
<input class="file" type="file" style="display: none;" name="image_file_1">
<input type="hidden" value="image_file_1" name="attachmentsForm[image][1][fileName]">
<input type="hidden" value="" name="attachmentsForm[image][1][filePath]">
<input type="hidden" value="local" name="attachmentsForm[image][1][fileLocation]">

so plz let me know what i have to use in

  1. File path( image is in D drive images folder and file name is img.5 type is png)
  2. Parameter Name
  3. MIME Type:

1 commentaire:

  1. In order to allow JMeter to pick your image up during recording process it needs to live under JMeter working directory (it may vary depending on how you launch JMeter but usually it is the same location where *jmeter.log* file lives - /bin folder of your JMeter installation). So if you drop your img5.png file to /bin folder and retry the process it should record upload event as expected.

    In regards to manual simulation of image upload event - use the following parameters:

    1. File path: full path to your image, i.e. `D:/img5.png`
    2. Parameter Name: `image_file_1`
    3. MIME Type: `image/png`

    For more information on properly simulating file upload and download events check out Performance testing: Upload and Download Scenarios with Apache JMeter guide

    RépondreSupprimer