Amit Ronen
Amit Ronen

Reputation: 161

Jmeter - ignore status for assertion on JDBC request

I'm running a while controller to check if a record added to our DB before the test can continue running. The JDBC requests fails on assertions as long as the record wasn't found. Is there an option to use something similar to ignore status (tried it but it didn't work on JDBC request) so the request won't show as 'failed' in 'View Results Tree'

assertion

While

Upvotes: 1

Views: 1031

Answers (2)

Moran
Moran

Reputation: 1

You can add a ResponseAssertion and checked ignore statusenter image description here

Upvotes: -1

Dmitri T
Dmitri T

Reputation: 168072

If you want to mark aSampler as successful regardless of its own status or status amended by the Assertion you can force set custom status using JSR223 Listener

  1. Add JSR223 Listener as a child of the request you would like to be marked as successful
  2. Put the following code into "Script" area:

    prev.setSuccessful(true)
    

    where prev stands for SampleResult class instance, see JavaDoc for more information on available functions and properties and Top 8 JMeter Java Classes You Should Be Using with Groovy article for more information on other useful JMeter API shorthands which are available in the JSR223 Test Elements

    enter image description here

Upvotes: 2

Related Questions