Checking responses in JMeter tests
In this recipe, we'll use some techniques to validate JMeter test results rather than just checking manually for an HTTP 200
response code.
Getting ready
You will need to install Oracle SOA Suite 11g for this recipe.
This recipe assumes that you have a loaded test plan. You can complete the Creating a web service test using JMeter and Running JMeter on multiple servers recipes, in order to have access to a working test plan against a composite. Alternatively you can use these steps with your own working test plan.
How to do it…
By following these steps, you can use assertions to check that the responses contain the correct data.
In the test plan, right-click on the Test Users thread group, and select Add | Assertions | Response Assertion.
In Assertion, ensure that the checkboxes Main sample only, Test Response, and Contains are selected.
Click on Add in Patterns to Test in the textbox, and enter
<result>2</result>
. Your test plan should look similar...