0
votes

I have a Thread Group with 10+ requests in same hierarchy.

I added Duration Assertion for all and it's working fine, except in 1 case:

If server is upload before test, first request failed due long duration caused by a server startup delay.

How can I ignore assertion in first request on the first execution?

1

1 Answers

0
votes

You can add a JSR223 Listener to your Test Plan and use the code like:

if (prev.getSampleLabel().equals('First Sampler') && vars.getIteration() == 1) {
   prev.setSuccessful(true)
}

It will mark the sampler with label of First Sampler as successful if it fails during first Thread Group iteration.

prev stands for SampleResult class instance, check out JavaDoc for available functions and properties. For example you might be interested in getAssertionResults()