gpt4 book ai didi

xpath - JMeter XPath查询未找到所需值

转载 作者:行者123 更新时间:2023-12-03 16:40:14 33 4
gpt4 key购买 nike

我收到JMeter的以下回应:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CertificateResponse>
<certificates>
<certificate>
<amount>
<value>100.00</value>
</amount>
<appleRetail>false</appleRetail>
<attributes>
<entry key="XYZ">444</entry>
<entry key="ABC">DEF</entry>
</attributes>
<cardType>1</cardType>
<datePurchased>06/13/2013 12:47:04:000 GMT</datePurchased>
<id>XWGL6GMXWN3P8TXL</id>
<lineItemNumber>1</lineItemNumber>
<purchaserDSIDLong>12860</purchaserDSIDLong>
<refID>XCard_0000250410356</refID>
<salesOrgId>
<description>US</description>
<ID>1</ID>
</salesOrgId>
<status>2</status>
<supportDSID>0</supportDSID>
<variableCard>false</variableCard>
<webOrderNumber>M33764265</webOrderNumber>
</certificate>
</certificates>
</CertificateResponse>


我在JMeter的HTTP Sampler中使用以下XPath查询,但我不愿意检索该值。

/CertificateResponse/certificates/certificate/id


我要去哪里错了?

最佳答案

我在JMeter的HTTP Sampler中使用以下XPath查询...


您的XPath表达式可以正常工作,但是您必须将其与附加到返回xml响应的采样器的XPath Extractor一起使用:



Use Tidy (tolerant parser): No

Reference Name: certificateID
XPath Query: //CertificateResponse/certificates/certificate/id
Default Value: NOT_FOUND


这会将 id的值提取到jmeter变量 certificateID中,您可以将其称为 ${certificateID}

关于xpath - JMeter XPath查询未找到所需值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17088627/

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