JMeter_User
JMeter_User

Reputation: 303

Capture response using Xpath extractor in Jmeter

I need to extract uuid from the below XML response using xpath extractor in jmeter. Can anyone help me with the expression>

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="schemas.xmlsoap.org/soap/envelope/" xmlns:awsse="xml.test.com/2010/06/Session_v3" xmlns:sca="www.w3.org/2001/05/addressing"><soap:Header><sca:To>www.w3.org/2005/08/addressing/anonymous</sca:To><sca:From><sca:Address>nodeA1.test.webservices.test.com/1ASIRFCUCPA</sca:Address></sca:From><sca:Action>webservices.test.com/test_Shopping_18.1</sca:Action><sca:MessageID>urn:uuid:ba154abc-636c-33b4-3947-6b50651b3f5b</sca:MessageID><sca:RelatesTo RelationshipType="www.w3.org/2005/08/addressing/reply">urn:uuid:55c875fa-bda3-461e-aa06-56c28f11ad38</sca:RelatesTo>

Upvotes: 0

Views: 45

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

Assuming that you're looking for the MessageID:

  1. You can use XPath name() function to extract the value like urn:uuid:ba154abc-636c-33b4-3947-6b50651b3f5b. The relevant expression would be:

    (//*[name() = 'sca:MessageID'])/text()
    

    enter image description here

  2. If you want just this ba154abc-636c-33b4-3947-6b50651b3f5b part - go for substring() function like:

    substring((//*[name() = 'sca:MessageID'])/text(),10)
    

    enter image description here

More information:

Upvotes: 0

Related Questions