1

I have a CSV Data Set Config,

enter image description here

I want to reference the variable Stack in my User Defined Variables and I have done it as follows,

I have used the __eval function to read the Stack variable

enter image description here

But in the request, I still see

https://${Stack}.testing.com

But I would like to see the value of the variable Stack from the CSV file.

I have tried the following,

__eval(${Stack}).testing.com  ->  ${Stack}.testing.com
__evalVar(Stack).testing.com  ->  .testing.com
${Stack}.testing.com          ->  ${Stack}.testing.com

Please advise on how can I reference the variable from CSV data set config in a User defined variable.

Thanks

9
  • Use just ${Stack} in your test plan. This will retrieve the value from the CSV. Commented Apr 25, 2017 at 18:14
  • I am able to retrieve the value from the CSV by using ${Stack}. Commented Apr 25, 2017 at 18:17
  • @NaveenKumarNamachivayam On using ${Stack} in User Defined Variable, I get ${Stack} I dont get the value of Stack. Commented Apr 25, 2017 at 18:17
  • Can you post your jmeter.log info. Commented Apr 25, 2017 at 18:18
  • @NaveenKumarNamachivayam I reference a variable from CSV in UDV and I use that UDV in my requests. If I directly use the variable from CSV in my request that works as you said. Commented Apr 25, 2017 at 18:18

2 Answers 2

2

You won't be able to do it using CSV Data Set Config as it is getting initialised after User Defined Variables, however you should be able to use __CSVRead() function instead like:

${__CSVRead(users/login.csv,3)}.testing.com

Demo:

JMeter CSVRead in UDV

See How to Use JMeter Functions posts series for more information on the above and other JMeter functions.

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

Comments

0

As per JMeter documentation, you cannot refer to variables it defines in the Test Plan - User defined variables.

Note that the Test Plan cannot refer to variables it defines.

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.