开发者

xpath Query for xpath extractor of Jmeter

Can someone please provide me the xml query for retrieving the value of sessionId from the below response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:createUserResponse xmlns:ns2="http://www.musicthp.com"     
                    isNewUser="false"
                    profileId="32109" 
                    sessionId="ryIlb+E5yj7FReA2w96uag=="
                    success="true">
<duration>316</duration>
</ns2:createUserResponse>

I tried using /ns2:createUserResponse/@sessionId and seems its not returning anything. I want to use this query in the XPATH extractor of jmeter. My requirement: I need to retrieve sessionId value using xpath extractor and use that value in the s开发者_如何学JAVAuccessive requests.

Thanks for your help in advance


Have you set JMeter to use namespaces?

JMeter has been reported to have problems with namespaces. If fiddling with settings won't help, here is a workaround for the root element

/*/@sessionId

Workaround for any element in a namespace is to use *[local-name() = 'element'] instead of prefix:element

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜