XPATH/JSONPath match by value

70 views
Skip to first unread message

jayamurugan parasuraman

unread,
Mar 7, 2018, 10:55:35 AM3/7/18
to hoverfly
Hello,
Could someone help me on doing exact match using XPATH/JSONPath by value ?
Sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<RMCustID type="book">
    Hoverfly Documentation
</RMCustID>


I know hoverfly can handle,
 "body": {
                        "xpathMatch": "//*[local-name()='RMCustID']"
                    }

how to handle this xpath by value? [Hoverfly Documentation]
//*[local-name()='RMCustID']/text()   

other than " Hoverfly Documentation" it should fail.

Please advise. Thanks You.

jayamurugan parasuraman

unread,
Mar 19, 2018, 2:56:07 AM3/19/18
to hoverfly
Any Update on my query ?

Tommy Situ

unread,
Mar 19, 2018, 5:23:04 AM3/19/18
to jayamurugan parasuraman, hoverfly
Hi Jayamurugan, 

What’s the XmlPath expression you had problem with? I didn’t understand your original question.

Have you validated your XmlPath expression with one of the online tool (such as https://www.freeformatter.com/xpath-tester.html


Thanks, 
Tommy

-- 
You received this message because you are subscribed to the Google Groups "hoverfly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoverfly+u...@specto.io.
To post to this group, send email to hove...@specto.io.
To view this discussion on the web visit https://groups.google.com/a/specto.io/d/msgid/hoverfly/95326f6a-2454-455e-acda-4fc67da405c8%40specto.io.

jayamurugan parasuraman

unread,
Apr 9, 2018, 6:23:42 AM4/9/18
to hoverfly, jaya...@gmail.com
Hi Tommy,
Sorry If my question is not clear.

For example 
<?xml version="1.0" encoding="UTF-8"?>
<RMCustID>1234</RMCustID> 
I am good with my xpath
1. //*[local-name()='RMCustID']   ====> This xpath make sure the presence of RMCustID in the request xml
                 2. //*[local-name()='RMCustID']/text()  ====> This give the value of RMCustID "1234"

In hoverfly i am able to use 1st xpath but how to use 2nd xpath in hoverfly ? That is how to validate 1234 present in my request.

Thanks,
Jayamurugan. P
Message has been deleted
Message has been deleted

jayamurugan parasuraman

unread,
Dec 6, 2018, 4:26:12 AM12/6/18
to hoverfly
Please let me know for any Updates 
Reply all
Reply to author
Forward
0 new messages