Hi All ,
Hi have created gatling framework to verify performance .
I am stuck at one point .
I want to upload xml file for post request .
I am not able to upload file.
I have tried following multiple approaches .
1.bodyPart(RawFileBodyPart(“./src/test/resources/Data/Burp.xml”))
2.formUpload(“Burp”, “./src/test/resources/Data/Burp.xml”)
3.body(RawFileBody(filePath = “./src/test/resources/Data/” + “Burp.xml”)).asMultipartForm
4.formUpload(“Burp.xml”, “./src/test/resources/Data/”)
5.bodyPart(RawFileBodyPart(“./src/test/resources/Data/Burp.xml”).contentType(“multipart/form-data”).fileName(“Burp.xml”))
6.bodyPart(StringBodyPart(“Burp.xml”, “./src/test/resources/Data/Burp.xml”).contentType(“multipart/form-data”).fileName(“bugcrowd.xml”))
7.bodyPart(StringBodyPart(“Burp.xml”,“./src/test/resources/Data/Burp.xml”))
8.body(RawFileBody(“./src/test/resources/Data/Burp.xml”))
9.bodyPart(RawFileBodyPart(“./src/test/resources/Data/Burp.xml”, “./src/test/resources/Data/Burp.xml”).fileName(“./src/test/resources/Data/Burp.xml”)
.transferEncoding(“binary”)).asMultipartForm
Still I am getting 500 error
I want to achieve following that I have achieved in post
In a “multipart” form, each part should have its own content-type.
Avoid file path relative to your project architecture (when compiled as jar, your simulation won’t find the path, as src/test/resources is directly at the root of the built jar)
Did you succeed to upload via curl? (I’m not sure what postman does under the hood)
“500” is “Internal Server Error” => not very useful. As you are pretty sure the request is faulty, it should response with “400 Bad Request”
@slandelle Hello ,
I am using following version
<gatling.version>3.6.1</gatling.version>
<gatling-maven-plugin.version>3.1.2</gatling-maven-plugin.version>