I used:
- Regular Expression Extractor (to check for the String of text)
- BSF Assertion (to manipulate the JSON object)
- Response Assertion (to check that the request was receiving the expected response)
- Convert the JSON Response into a Javascript Object.
- Create a variable that will count how many items are in the list.
- Loop through the list and check that each "href" element contains the href value that we expect.
- In my case there are 2 types of response: Chat Event OR Message Status, so I want to choose this selectively or I will get an error saying the object cannot be found.
- I copy the Chat Event/MessageStatus into a variable. If the variable is 'false'/null I check the other.
- I get the URL out of the response and store it as a variable 'x'
- I then put the URL into a variable called "href + i" (ie. href1, href2, ...)
- I get the variable href+1 and check if it contains the specified String of text.
Now we preform a conditional IF statement on the response that will check for "href" within each instance, if it contains the value we expect.
200 OK: Standard response for successful HTTP requests.
Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a variety of services, with a focus on web applications.
JMeter can be used as a unit test tool for JDBC database connections, FTP, LDAP, Webservices, JMS, HTTP, generic TCP connections and OS Native processes. JMeter can also be configured as a monitor, although this is typically considered an ad-hoc solution in lieu of advanced monitoring solutions.
JMeter supports variable parameterization, assertions (response validation), per thread cookies, configuration Variables and a variety of reports.