Unable to capture value form request using Xpath

13 views
Skip to first unread message

amit me

unread,
Nov 21, 2019, 2:12:43 AM11/21/19
to hoverfly
Hi I am trying to capture the value from Request using Xpath but it is not working. I have captured the simulation json which has XML body for a post request but when I tried to capture value from XML body it not working. Kindly help.

Request- response pair has below items:

Request from postman:
Method: Post
Body: xml= <root><id>8</id></root>

In simulate.json:
"body": [
{
"matcher": "glob",
"value": "*"
}


Using below xpath in response in simulate.json:

"response": {
"status": 200,
"body": "<id>{{   Request.Body \"xpath\"  \"/root/id\" }}</id>",

 But after running it gives result as <id></id>. Please help here.
Reply all
Reply to author
Forward
0 new messages