Closed AntonioSun closed 2 years ago
Yes, I believe so. In this, it behaves the same as in JMeter GUI, If you put it under the group each thread from this group would have its own cookie storage area and each request should use it.
Thanks while I have you, if I put https://github.com/smicyk/groovy-jmeter/wiki/reference#headers under the group, just like the cookies()
above, with some default values, like Host, Origin, Referer, Connection, User-Agent etc,
Would each thread from this group and each request use such default values, together with the headers specified for themself?
Yes.
Great! Thanks for the confirmation!
Hi @smicyk,
How about
check_response {
status() eq 200
}
Does it has to go with each request, or I can place one at group level just like the cookies()
above?
What if I want to check each response for keyword "Wrong
" and mark the request fail if found. What's the best/simplest way to do that and how to do it please?
If you put check_response on group level it will be added to all request (the assertion will check each request during execution). Please note, that you can't override assertion if you would like to have some different check on one particular request e.g.
plan {
group {
http 'GET /books'
http 'GET /authors', {
check_response {
status() eq 404
}
}
check_response {
status() eq 200
}
}
Then the /books will be asserted only with status eq 200 and /authors will be asserted with status eq 200 and status eq 404. So one of them will fail.
How to set a default cookie manager to all my requests?
This
cookies()
applies to all my requests under this group?