Reputation: 183
Are the assertions in JMeter, executed/checked on the basis of the order of occurrence or randomly ?
I am having two (or more) assertions to all of my HTTP requests, one of them is always a response assertion checking the response code. Other one being more detailed BSF Assertion. If my response code assertion fails I don't care if the other assertion passes or fails, so I don't want it to be executed/checked.
Any suggestions for the same ?
Upvotes: 1
Views: 521
Reputation: 167992
Assertions are executed upside down. So if you put BSF Assertion under Response Assertion and populate it as follows:
if (SampleResult.isSuccessful()){
//your extended assertion logic here
}
extended BSF Assertion will be fired only if the following conditions are met:
If the any of condition fails only first line of the extended BSF Assertion will be executed.
For more information on using JMeter Assertions see How to Use JMeter Assertions in 3 Easy Steps guide.
Upvotes: 1
Reputation: 1733
Assertions are executed on basis of the order of occurrence, and currently in Jmeter there is no mechanism to skip/ignore any one assertion based on the result from previous assertion.
Probably you can combine both assertions in to BSF Assertion
where you first do a check on response code and if response code is correct/expected then do the detailed assertion.
hope this will help.
Upvotes: 1