I would like for some branch of the test to execute only if the response code from a previous sample returns with a certain HTTP code 200.
I tried the following as the condition to the 'if controller':
"{httpCode}"== "200"
but no luck (and no luck debugging it, debug sampler says nothing)
Thanks
Did you extract response code to variable httpCode beforehand? Use regex extractor for it http://jmeter.apache.org/usermanual/component_reference.html#Regular_Expression_Extractor
Then check value of variable like that:
${__javaScript(${httpCode}=="200")}
Alternatively, you may use assertion, see https://stackoverflow.com/a/11669393/808594
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With