You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tong Sun <su...@gmail.com> on 2020/12/07 18:13:06 UTC

Using Test Plan variables to define another Test Plan variable

I've defined the following variables on the Test Plan:

HOST             www.example.com
URL                ${__P(URL, __V(https://${HOST}/api/path))}

I.e., I want to define a Test Plan variable from the previously
defined existing Test Plan variable(s), if URL is not
defined/overwritten on cli. How to do that? Mine above is not working.

thx

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Using Test Plan variables to define another Test Plan variable

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 07.12.20 um 19:13 schrieb Tong Sun:
> I've defined the following variables on the Test Plan:
>
> HOST             www.example.com
> URL                ${__P(URL, __V(https://${HOST}/api/path))}
>
> I.e., I want to define a Test Plan variable from the previously
> defined existing Test Plan variable(s), if URL is not
> defined/overwritten on cli. How to do that? Mine above is not working.

Try to move the definition of URL to a User Defined Variable config
element. The variable HOST is not visible at the level of the test plan
and JMeter can not evaluate it that early. While you are moving the
definition, make sure to correct the replacement string by leaving out
'__V(' and one ')' at the end. The correct definition for URL would be
${__P(URL, https://${HOST}/api/path)}

Felix

>
> thx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org