【问题标题】:Capture response using Xpath extractor in Jmeter在 Jmeter 中使用 Xpath 提取器捕获响应
【发布时间】:2019-10-04 01:36:33
【问题描述】:

我需要使用 jmeter 中的 xpath 提取器从以下 XML 响应中提取 uuid。任何人都可以帮我表达一下>

<?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>

【问题讨论】:

    标签: xpath jmeter


    【解决方案1】:

    假设您正在寻找MessageID

    1. 您可以使用 XPath name() 函数来提取像 urn:uuid:ba154abc-636c-33b4-3947-6b50651b3f5b 这样的值。相关的表达方式是:

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

    2. 如果您只想要 ba154abc-636c-33b4-3947-6b50651b3f5b 部分 - 使用 substring() 函数,例如:

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

    更多信息:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-18
      • 2012-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多