Take Jmeter as an example, for correlation work, there is two ways to catch dynamic value
1. using Regular Expression Extractor-- you can write simple Regular Expression to extract the value
2. using XPath Extractor--write Xpath to seek the value
Here is a simple example to show how you deal with web service correlation work using Xpath :
I want to get the token value returned by the server, here is the response XML:
Xpath: //*[local-name()='token']
how about there is the namespace in the XML?? just like this:
XPath://*[local-name()='token' and namespace-uri()="http://api.user.123.com"]
it is simple, and user-friendly :)
at Last, you can test your Xpath expression here : http://www.mizar.dk/XPath/Default.aspx
hope this helps!
No comments:
Post a Comment