Using {variables} in XPath Responder Correlation
Is it possible to use Responder Suite {variables] in the XPath Request Body correlation?
e.g. /:Envelope/:Body/:someRequest/:someNode/*:color/text()="{color}"
Comments
-
Yes it is, the only thing that you need to make sure happens is to use the "${variable_name}" syntax.
Do note though that if you fill in fields this way you will not be able to test your XPath in the editor, since the variable will only resolve at runtime or when your asset is invoked.
1 -
Thanks for the quick reply. I tried using "${color}" and it does not appear to be working. I get a 404 response showing that the match failed. The XPath in the "criteria" listed in the response shows the variable reference, not the expected value.
0 -
Hi,
I see the same thing when I try to use a variable in the xpath. Would a data source correlation work in your case? The "variable" would come from a row of data in the data source so it could match many different "colors"1 -
Yes, that worked. Thanks guys. I added a datasource and used that for the correlation. Very cool.
0 -
Happy to help!
0