mani9697
mani9697

Reputation: 53

JMeter Assertion to verify the count of records inserted into database

What I am trying to achieve:

Insert records into Database and verify that the count of records inserted matches with the expected count.

Steps performed:

Assertion Result:

Assertion error: false Assertion failure : true Assertion failure message: Test failed: variable(RESULT)expected to equal/

*******received : [[[[{RESULT=1}]]]] *******comparison: [[[{RESULT=1} ]]]

If this issue is resolved, I want to increment the count. Please advise.

Upvotes: 0

Views: 2857

Answers (1)

Gabriel
Gabriel

Reputation: 130

When using the JDBC Requests, your variables are returned like this: RESULT_1, RESULT_2 and so on..so your variable is actually RESULT_1. So the short answer would be like this:

In the Response Assertion you have to do the following:

  1. 'JMeter Variable' as RESULT_1
  2. Select the 'field to test' as 'Text Response'
  3. 'Pattern Matching Rules' as 'Equals'
  4. 'Patterns to Test' as '1'
  5. Execute the script

enter image description here

Upvotes: 0

Related Questions