Call a function or substitute a variable value withing another variable.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Call a function or substitute a variable value withing another variable.

Pavel Gouchtchine
HI All,
I am getting values for a HTTP request from a csv file.
For example value for ${payload} variable comes from the "payload" column
in the csv file.
is it possible to use a function call or another variable within payload
field value in the csv file?
is there a mechanism to evaluate all functions and variables into their
values?

Thank you, very much.
Pavel.
Reply | Threaded
Open this post in threaded view
|

Re: Call a function or substitute a variable value withing another variable.

glinius@live.com
This post has NOT been accepted by the mailing list yet.
Wrap your function or variable call with the __eval(), it will process the value coming from file and resolve it to JMeter function or variable if is contained there.

More information on playing with complex variables: Here’s What to Do to Combine Multiple JMeter Variables
Reply | Threaded
Open this post in threaded view
|

Re: Call a function or substitute a variable value withing another variable.

Felix Schumacher
In reply to this post by Pavel Gouchtchine


Am 20. Januar 2017 01:22:55 MEZ schrieb Pavel Gouchtchine <[hidden email]>:

>HI All,
>I am getting values for a HTTP request from a csv file.
>For example value for ${payload} variable comes from the "payload"
>column
>in the csv file.
>is it possible to use a function call or another variable within
>payload
>field value in the csv file?
>is there a mechanism to evaluate all functions and variables into their
>values?

Have you tried something like ${__groovy${payload}}? You can replace groovy with javaScript or jexl3.

There will be some limits on the content of payload, but it might work for you.

Regards,
 Felix
>
>Thank you, very much.
>Pavel.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]