'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 ?
Solution 1:[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.
- Assertions are being executed upside down
- If any of assertions fails - the Sampler will be marked as failed
- 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:
- Assertion Results listener output
- JMeter Log file
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dmitri T |
