0

I'm trying to share variables between two CSV Data Set Configs in jmeter but unfortunately all config elements are loading in the same time so it's not able to read freshly imported variables from CSV files.

  1. I want to import CSV files with login,password,thirdVariable CSV Data Set Config Test Plan Image
  2. I want to pass third variable as a part of the file path to the next Csv Data Set Config Second CSV Data Set Config with variable from first one

Actual result: java.lang.IllegalArgumentException: Could not read file header line for file C:/.../Csv_files/Something/${department}/Get_Something.csv

I need to run the same test for different users with login, password and third variable.

${__CSVRead(UsersLogin/Users.csv,n)} can import only one variable.

Is there any possibility to pass variables between CSV Data Set Configs even if they are created in the same time? Or there is any other solution?

1 Answer 1

1

${__CSVRead(UsersLogin/Users.csv,n)} can import only one variable.

that might be, however it depends on how you're using this function, according to documentation:

The column number in the file. 0 = first column, 1 = second etc. "next" - go to next line of file. *ALIAS - open a file and assign it to the alias

So if you have CSV file looking like:

[email protected],secret
[email protected],admin
etc.

You can read the values using the following functions:

  1. First column, first row: ${__CSVRead(test.csv,0)}
  2. First column, second row: ${__CSVRead(test.csv,1)}
  3. Proceed to the next row: ${__CSVRead(test.csv,next)}
  4. Then again you can repeat steps 1 and 2 to read data from 1st and 2nd column respectively

Demo:

enter image description here

More information: How to Pick Different CSV Files at JMeter Runtime

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

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.