user1207289
user1207289

Reputation: 3253

JSR223 assertion on JDBC update request in Jmeter

I have JDBC request which updating some value in database. For this request, I have two child assertions one response and one JSR223 to check response code and updated value respectively . But I get a failed request (red) in view results tree as I think JSR223 is asserting value before it is updated. When I check database manually , value is being updated.

I was assuming that by putting response assertion before JSR223 assertion , it would be fine as JSR223 will assert when request has been fully executed.

When I disable JSR223, I get response assertion passed and hence green request in result tree.

How do I assert on the value updated by the JDBC request in this scenario ?

Upvotes: 0

Views: 320

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

  1. As per JMeter Test Elements Execution Order: assertions are being executed after Samplers so JDBC Request sampler is "fully" executed and only after that Assertions are being executed.
  2. Assertions are being executed upside down
  3. If any of assertions fails - the Sampler will be marked as failed
  4. Specific for the JSR223 Assertions: if you made a mistake and the code won't compile - the assertion will fail and fail the relevant Sampler. See Scripting JMeter Assertions in Groovy - A Tutorial article for more details if needed.

So double check your assertion code and inspect:

  1. Assertion Results listener output
  2. JMeter Log file

Upvotes: 1

Related Questions