SOAP:Body
top
busauthenticationuser
${user}
${user}
${user}
</SOAP:Body>
</SOAP:Envelope>"""
…
body(myBody)
SOAP:Body
top
busauthenticationuser
${user}
${user}
${user}
</SOAP:Body>
</SOAP:Envelope>"""
…
body(myBody)
Thanks. I use this code:
val authuser = “”"<SOAP:Envelope xmlns:SOAP=“http://schemas.xmlsoap.org/soap/envelope/”>
SOAP:Body
cn=${user},cn=authenticated users,cn=cordys,cn=defaultInst,o=vanenburg.com
${user}
cn=everyoneInsystem,cn=organizational roles,o=system,cn=cordys,cn=defaultInst,o=vanenburg.com
${user}
top
busorganizationaluser
busorganizationalobject
</SOAP:Body>
</SOAP:Envelope>"""
val chain_1 =
exec(http(“auth user”)
.post("/home/system/com.eibus.web.soap.Gateway.wcp")
.headers(headers_1)
.basicAuth(“username”, “pw789”)
.param("${user}", “stephan”)
.body(authuser)
)
But it is not changing the ${user} parameter in the body. What is wrong?
GJ
Looking at your simulation, it looks like you want to use param(…) to set user to “stephan”.
Am I wrong ?
Making Pierre question clearer: it looks like you misunderstand “param” usage. Param is for setting a form parameter, not setting a value into the session so that it can be injected into templates/ELs.
The standard way of injecting data is to use a Feeder:
https://github.com/excilys/gatling/wiki/Feeders
Cheers,
Stéphane
Yes, that’s right, I want to change the variable ${user} to “stephan”.
So use a feeder (see my previous mail).
If you really want to go fast and just check that your simulation runs fine, you can manually add it:
.exec(session => session.setAttribute(“user”, “stephan”) // replace this with a Feeder when you feel ready
.exec(http(“auth user”)
.post("/home/system/com.eibus.web.soap.Gateway.wcp")
.headers(headers_1)
.basicAuth(“username”, “pw789”)
.body(authuser)
)
Yes, that is working fine. Thanks for the fast response!