Reputation: 2574
I want to Assert a value (ActualCode
) in XPath Assertions
. I am experienced with JSON Path Assertion but totally new to XML one. How could I assert the 'ActualCode' value here?
<?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>
Upvotes: 0
Views: 802
Reputation: 168227
namespaces.properties
somewhere, for example in JMeter.s "bin" folder. Add the following lines to the namespaces.properties file
S=http://schemas.xmlsoap.org/soap/envelope/
ns2=http://www.example.net/lmsglobal/ws/v1/extint/types
Add the next line to user.properties file, it lives under JMeter "bin" folder as well
xpath.namespace.config=namespaces.properties
Use Namespaces
boxPut the following query into the "XPath Assertion" input:
//ns2:ValidCode/text()='ActualCode'
That should be it.
Useful material:
Demo:
Upvotes: 1