3

I have this set of variables: enter image description here

My path in request looks like this: enter image description here

But when I run the test URL looks like this: enter image description here

But what I expect is : GET http://somehost:9000/v1/customers

So how to concatenate this variable correctly:

CUST.LIMITS.URL      ${__V(${ENV}.BASIC.URL)}/customers

2 Answers 2

3

It seems like JMeter has some kind of variable parsing ordering issue when it tries to solve nested variable references.

But you can workaround this if you define another "User Defined Variables" element after the one you already have. Then take the "CUST.LIMITS.URL" from the first "User Defined Variables" and add it to the second one.

So you will have something like this:

First "User Defined Variables":

ENV                  DEV
DEV.BASIC.URL        somehost:9000/v1
QA.BASIC.URL         

Second "User Defined Variables":

CUST.LIMITS.URL      ${__V(${ENV}.BASIC.URL)}/customers     

In the Request:

You don't need the ${__V()} call. Just use plain: ${CUST.LIMITS.URL}

Sign up to request clarification or add additional context in comments.

Comments

0

You can work it around as follows:

  1. In the User Defined Variables define variables as:

    • DEV.BASIC.URL - somehost:9000/v1
    • CUST.LIMITS.URL - ${DEV.BASIC.URL}/customers
  2. In your HTTP Request sampler you can refer concatenated variable using __eval() function like:

    ${__eval(${CUST.LIMITS.URL})}
    

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.