четвртак, 19. децембар 2013.

Extract value from XML response



How to extract value from XML response in Jmeter?


XPath Extractor allows us to extract value from structured response - XML - using XPath query language.

Let’s create a simple Xpath query which will extract the contentLink value from response bellow..

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contentLinks xmlns="http://www.yourdomain.com/ckkl/content/contentupdate/1.0">
             <contentLink>
                        http://community.test.domain.com/content/csl/map/
             </contentLink>
</contentLinks>

We can extract value between tags "contentLink" using xpath querry: //contentLinks/contentLink and put in in variable URL.



 Add the XPath Extractor as child element of the HTTP Request:




Нема коментара:

Постави коментар