Unanswered question

How to inject a variable value in multiple injection points?

I have a variable 'transactionId' that must be injected in either form post parameters, jsonpaths, or query string parameters. There are three different names of form post parameters, six different jsonpaths and three different query string parameters to inject the variable value. The form post parameters can be TransactionId, transactionId or tranId. The jsonpaths can be $..tranId, $..transactionId, $..TranId, $..id etc. etc. etc. As far as I can tell, in a framework rule only two of those can be combined. Do I have to create 9 or more different framework rules to inject in every possible location, or is there a more elegant way that combines all 12 injection points?

Albert Z.
Albert Z.

Albert Z.

Level
0
10 / 100
points

Answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

What matters is the value that you would like to replace by your "transactionid" variable.

So in the replacement panel in your framework rule you can select "Parameter Value" and Whole or Part of the value depending on which one is true in your case.

You can enable "Text content" with "Regular expression" and then the settings depends on your data to figure out if a JSONPath is better than a regular expression or not.

I can't tell if one framework is enough or if more are needed but again you misunderstood the point where it's the value that is important and not the parameter names.

 

Albert Z.
Albert Z.

Albert Z.

Level
0
10 / 100
points

@Nouredine, technically your answer is correct. You got me there on a language technicality. However, it is as useless as I ever can imagine. Of course I meant "I have a variable 'transactionId' of which the value must be injected in ...". Anyway, so your answer is "No, you really have to make separate rules for every injection point."?

I think what Nouredine meant is that in a framework rule, we don't care about any name given to a value in a request. transid, fred, bob, token, all the rule cares about is that if it sees an value "qwerty12345" in a response, it will replace it everywhere it see "qwerty12345" in a future request, whether this is within a url, a parameter, a xml string. So effectively, one rule could cover every replacement