dynamic response and regex
I'm new to Jmeter.
I'm trying to use regular expressions to verify I get the correct response from an API.
The problem is the some tags in the API response are dynamic: they do not appear always and the number of tag may change.
For example, the APi should return for each student the courses he/she is taking and the grades. There is a tag for each course and in it a list of tags for each grade.
But student A might have 5 courses, while student B might have 7 courses.
Also each course may return more than one grade per course.
Can this be done?
Regular Expressions is not the best way to deal with XML data, I would suggest going for XPath Assertion instead.
Assertion can be applied not only to response, they could target JMeter Variables so you can extract some response bit with i.e. XPath Extractor and perform assertion against resulting variable.
See How to Use JMeter Assertions in 3 Easy Steps guide for more information regarding assertions scope, cost, best practices, etc.
Tags for this Thread