multipart/related implementation in gatling

Hi Stephane,

I am trying to test multipart/related POST request using gatling.

The gatling script is attached. Please let me know how to make this work.

I am seeing a 500 internal error.

I have to upload an xml file and a jpeg file as part of POST request which uses multipart/related mime.

The xml file will not take any file name , but the png or jpeg file has the name “image”.

Also let me know which gatling snapshot should i use ?


  • show quoted text -

ICN.scala (1.78 KB)

Which version did you use?
Do you have any log on the server side?

Hi Stephane,

Can I use RawFileBodypart without the first parameter, name?

. exec(

my requiremnet is I need to upload an xml file as the first body part without filename and the second body part is a image with filename “image”.

How can i implement this in gatling ?

You can’t write it this way, at best, you can pass an empty parameter.
Then could you elaborate about your use case, please?
You mean that your server is not able to properly parse the multipart message if this part has a name?

Hi Stephane,

I have a testc ase where I need to run a series of scnearios for 1 hour. How do we specify this in gatling. Please see the simulation set up below.

setUp(scn1.inject(rampUsers(3) over(30 minutes)),
scn2.inject(rampUsers(3) over(30 minutes)),
scn3.inject(rampUsers(3) over(30 minutes)),
scn4.inject(rampUsers(3) over(30 minutes)),
scn5.inject(rampUsers(3) over(30 minutes)),
scn6.inject(rampUsers(3) over(30 minutes)),
scn7.inject(rampUsers(3) over(30 minutes)),
scn8.inject(rampUsers(3) over(30 minutes)),
scn9.inject(rampUsers(3) over(30 minutes)),
scn10.inject(rampUsers(3) over(30 minutes)),
scn11.inject(rampUsers(3) over(30 minutes)),
scn12.inject(rampUsers(3) over(30 minutes)))

I want all the scenarios to be run with 3 users and for a duration of 30 minutes. Please see the simulation file attached.

Please reply at the earliest possible.

largefiletest2.scala (14.2 KB)

Hi Stephane,

Did you get a chance to look into this.

I would like to run my scenarios with standard users of 3 for a period of 1 hour. How can I do this in gatling?



Please don’t hijack an unrelated thread.
Open a new one.