the built-in cookie handling is overwriting my special header named Cookie, and fail transaction the second repeat. First hit was fine though
thank you
the built-in cookie handling is overwriting my special header named Cookie, and fail transaction the second repeat. First hit was fine though
thank you
…
.repeat(2){
exec(http(“resource”)
.post("/resources")
.headers(Map(“Cookie” → "qbn.ptc.gauthid=1075556084; qbn.ptc.parentid=50000000; qbn.ptc.authid=1075556084; qbn.ptc.agentid=1075556084"
.body(StringBody(s"""{“abc”}"""))
.check(status.is(200))
)
…
here are request headers from 2 repeats. (first one works with correct customer Cookie, second one failed because customer Cookie not send at all
=====2. Bad
headers=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0
cookie: ADRUM_BTa=R:0|g:e85f5d5c-9bda-4bfe-a2d2-3f82adcf22aa|n:intuit-ss-dev_3b662425-b849-4961-afd2-c0d77ddcf9d0; ADRUM_BT1=R:0|i:46557; ADRUM_BTs=R:0|s:f; apip=1075556084
origin: https://developer
host: developer
content-type: application/json
content-length: 10366
cookies=
ADRUM_BTa=R:0|g:e85f5d5c-9bda-4bfe-a2d2-3f82adcf22aa|n:intuit-ss-dev_3b662425-b849-4961-afd2-c0d77ddcf9d0, path=/, maxAge=30s
ADRUM_BT1=R:0|i:46557, path=/, maxAge=30s
ADRUM_BTs=R:0|s:f, path=/, maxAge=30s
apip=1075556084, path=/, maxAge=315360000s
======1st. Good
headers=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0
Cookie: qbn.ptc.gauthid=1075556084; qbn.ptc.parentid=50000000; qbn.ptc.authid=1075556084;qbn.ptc.agentid=1075556084
accept: /
origin: https://developer
host: developer
content-type: application/json
content-length: 10366
Add cookies the way mentioned bewlow. create object and call this steps in header for each request. You can set all cookies
exec(addCookie(Cookie(“qbn.ptc.gauthid”,“1075556084”).withDomain(".yoursitename.com").withPath("/").withMaxAge(86400)))
Thank you G Madhana Mohana Reddy:
Are you saying that in stead of class, i need to (format like) below: ?
object test{
val scn1 = scenario(“test cookie repeat”)
.repeat(2) {
.exec(http(“test”)
.post(“target”)
.exec(addCookie(Cookie(“qbn.ptc.gauthid”,“1075556084”).withDomain(".yoursitename.com" ).withPath("/").withMaxAge(86400)))
}
}
setup scn1.inject…
Jack
Yes Jack.