gpt4 book ai didi

xpath - Xpath Post Processor:从SOAP响应中提取节点内容

转载 作者:行者123 更新时间:2023-12-03 07:28:54 24 4
gpt4 key购买 nike

我有这种形式的肥皂回应

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:Responseto xmlns:ns2="http://xyz.company.com/">
<return>
<objectContent xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">/path/to/file.txt</objectContent>
<objectType>FILEPATH</objectType>
<rid>111</rid>
<sid>2</sid>
</return>
</ns2:Responseto>
</S:Body>
</S:Envelope>

我希望提取jmeter中的对象内容,以提供给xpath断言。

谁能建议该怎么做?

我尝试了 //return/objectType,但随后DebugSampler向我显示了我的变量的值为空。

最佳答案

  • 将XPath Extractor放置为具有您提到的响应的Request的子代。
  • 像这样配置提取器:
    "Main Sample" Only
    "Use Namespaces" checked
    "Ignore Whitespaces" checked
    "Return entire XPath fragment instead of text content" Unchecked
    "XPath query" : //return/objectType

  • 我测试了它的工作原理。

    关于xpath - Xpath Post Processor:从SOAP响应中提取节点内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12679193/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com