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

  • Thomas MooreThomas Moore Posts: 72 admin

    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.

  • jefftuckerbofajefftuckerbofa Posts: 29

    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.

  • williammccuskerwilliammccusker Posts: 211 ✭✭

    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"

  • jefftuckerbofajefftuckerbofa Posts: 29

    Yes, that worked. Thanks guys. I added a datasource and used that for the correlation. Very cool.

  • williammccuskerwilliammccusker Posts: 211 ✭✭

    Happy to help!

Sign In or Register to comment.