I’m trying to improve a script that I already have for load testing with Gatling. The scripts consist in injecting data filling forms with different type of inputs(dropdowns, textboxes, checkboxes, etc…). Now I have a form to upload attachments and I am trying to POST a PDF file but I have not found a way to do it.
Can you please take a look to the question I posted in Stackoverflow to get more context? Unfortunately i cannot attach more than 1 screenshot here.
I’m pretty sure I’m doing something very wrong, this is the .exec I’m currently have
.exec(http("Upload the file")
.post("/private/private/private/forms/submit")
.headers(shared_headers)
.formParamMap(Map(
"resumableChunkNumber" -> "1",
"resumableChunkSize" -> "1048576",
"resumableCurrentChunkSize" -> "10080",
"resumableTotalSize" -> "10080",
"resumableType" -> "application/pdf",
"resumableFilename" -> "Caso_SimuladoSC_202.pdf",
"resumableRelativePath" -> "Caso_SimuladoSC_202.pdf",
"resumableTotalChunks" -> "1"))
.bodyPart(RawFileBodyPart("file", "Caso_SimuladoSC_202.pdf")
.fileName("Caso_SimuladoSC_202.pdf")
.transferEncoding("binary")).asMultipartForm
)// end exec
The PDF file is in my Gating repo with another files.
How can I achieve this? Any idea? My Gatling version is 3.7.6