When it comes to dealing with XML or (X)HTML, JMeter comes bundled with an XPath Extractor component that allows you to extract matches from XML server responses using an XPath query language. For instance, extracting the title of a standard HTML structure can be accomplished using
html/head/title, getting all the paragraphs can be accomplished using
body/p, and so on. Moreover, when dealing with web services, particularly SOAP services, XMLs are used heavily as a means of exchange. This component is a perfect fit for handling such responses and extracting the needed information.
In this recipe, we will cover how to use XPath Extractor to handle XML server responses. Perform the following steps: