Unanswered question

How do I get a parameter substituted in a POST of request content type TEXT?

In NeoLoad 4.2.2 I put an extracted variable in the text content of a POST request of content type text and it is not being replaced by the value at run time. If I switch to type form it will be replaced in either the name or the value but then I get an extra equals sign which doesn;t process correctly.

Nelson C.
Nelson C.

Nelson C.

Level
0
35 / 100
points

Answers

Nelson C.
Nelson C.

Nelson C.

Level
0
35 / 100
points

I figured it out, but it's not obvious
1. Change the Post content type to FORM
2. Put your variable in the Name field, leave the value field blank
3. In Advanced uncheck "Put equals"
It will now put your variable in with no equals sing and replace it at runtime. STLL - there seems to be a bug that text type will not replace the value of the variable at runtime. That should be fixed.

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

Having a variable in a POST request of content type text is very common. I've tried from a NeoLoad 4.22 with also an extracted variable and it worked fine.

There's probably something specific from your script configuration. If you use another variable coming from the variable manager, do you get your variable replaced?

 

Nelson C.
Nelson C.

Nelson C.

Level
0
35 / 100
points

What I don't see is how to insert the variable using a variable picker. So I just type the variable name in the text field where it goes ${varname} but in this case it does not get replaced. So is there some trick to pasting in the variable so it's recognized as a variable and not just text?

Nelson C.
Nelson C.

Nelson C.

Level
0
35 / 100
points

Ok, realized if you start typing ${ it will bring up the variable list and that works!