You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by David Luu <ma...@gmail.com> on 2016/04/18 22:05:14 UTC

Best way to entering property value that contains commas for a property function call?

I define some user defined variables whose values are JMeter properties
with a default value:

${__P(myproperty,defaultValue)}

I notice you run into issue when the default value is a string that
contains commas. JMeter would fail to interpret it and return the the whole
line above literally as the value of the variable (not preprocessed
beforehand).

e.g. ${__P(myproperty,"testing,123")}

I tried quoting the string with double quotes, single quotes, having it
unquoted, trying to have some other function render the string (e.g.
"__javascript()"). All didn't seem to work. In the interim, my solution was
to define the static default value as another variable up one node (to be
predefined) then insert that as the default value in the property function
for the variable in question.

Is that the best workaround for this or are there other useful alternatives?

Re: Best way to entering property value that contains commas for a property function call?

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
commas need to be escaped as \,

http://jmeter.apache.org/usermanual/functions.html
If a function parameter contains a comma, then be sure to escape this with
"\", otherwise JMeter will treat it as a parameter delimiter.

regards
deepak



On Mon, Apr 18, 2016 at 1:05 PM, David Luu <ma...@gmail.com> wrote:

> I define some user defined variables whose values are JMeter properties
> with a default value:
>
> ${__P(myproperty,defaultValue)}
>
> I notice you run into issue when the default value is a string that
> contains commas. JMeter would fail to interpret it and return the the whole
> line above literally as the value of the variable (not preprocessed
> beforehand).
>
> e.g. ${__P(myproperty,"testing,123")}
>
> I tried quoting the string with double quotes, single quotes, having it
> unquoted, trying to have some other function render the string (e.g.
> "__javascript()"). All didn't seem to work. In the interim, my solution was
> to define the static default value as another variable up one node (to be
> predefined) then insert that as the default value in the property function
> for the variable in question.
>
> Is that the best workaround for this or are there other useful
> alternatives?
>