I have a result of a function in a NeoLoad variable inside my Javascript:
context.variableManager.setValue("body", body);
How can I use this variable in a Method: Post and Content Type: text ?
I tried with ${body} in the Text Content but it does not work.
Thanks
Hi, the issue is the evaluate function is never called, you need some javascript above or below the function that calls it
It is the right way to use your variable. When you say it does not work do you mean that the variable is not replaced while replaying your request?
Could you provide some screen shots describing that behavior?
As you can see, I execute de JS named "JavaScriptGeneratingBody", (attached the code in the below image). The response generates 400 error.
What I want is generate 10 random json. The variables "randomAccountNumber", "randomBalance"... work perfectly. The problem is when I try to capture the variable "body".
Thanks
I'm not a JS specialist but if i use your code without the evaluate function it works fine. I can't tell why it does not work inside your evaluate function.
This is the solution, deleting the the line of the evaluate function works fine.
Thanks a lot!