Hi All
P.S: This is not a web application
I am new to Gatling and need experts help here, hence this post.
I have written a sample gatling program to read request xml from a file which has static values.
Sample code looks like below:
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class callOperationSimulation extends Simulation {
val httpProtocol = http
.baseURL(“baseURL”)
.inferHtmlResources()
.acceptEncodingHeader(“gzip,deflate”)
.contentTypeHeader(“text/xml;charset=UTF-8”)
.userAgentHeader(“Apache-HttpClient/4.1.1 (java 1.5)”)
val headers_0 = Map(“SOAPAction” → “”"“MYID_OP_CALL_OPERATION”""")
val uri1 = “fullURL”
val scn = scenario(“callOperationSimulation”)
.exec(http(“request_0”)
.post(“actualURL”)
.headers(headers_0)
.body(RawFileBody(“callOperationSimulaition_0000_request.txt”)))
setUp(scn.inject(atOnceUsers(4))).protocols(httpProtocol)
}
Now, I want to enhance this program to populate dynamic values into the request xml .
Can someone help me to understand how this can be achieved?
Also, instead of specifying the file path in .body(), can i directly paste the xml? If yes, can someone share any sample ?
Thanks
Praveen