[英]XML Path Assertion in Jmeter
我想在XPath Assertions
一個值( ActualCode
)。 我對JSON路徑聲明有豐富的經驗,但對XML而言是全新的。 我如何在這里斷言“ ActualCode”值?
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:CreateValidCode xmlns:ns2="http://www.example.net/lmsglobal/ws/v1/extint/types" xmlns="http://www.example.net/lmsglobal/xsd/v1/types" xmlns:ns3="http://www.example.net/lmsglobal/ws/v1/extint/notification/types">
<ns2:ValidCode>ActualCode</ns2:ValidCode>
<ns2:State>1</ns2:State>
</ns2:CreateValidCode>
namespaces.properties
。 將以下行添加到namespaces.properties文件
S=http://schemas.xmlsoap.org/soap/envelope/ ns2=http://www.example.net/lmsglobal/ws/v1/extint/types
將下一行添加到user.properties文件,它也位於JMeter的“ bin”文件夾下
xpath.namespace.config=namespaces.properties
Use Namespaces
框 將以下查詢放入“ XPath斷言”輸入中:
//ns2:ValidCode/text()='ActualCode'
應該是這樣。
有用的材料:
演示:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.