0
votes

I have a single CSV file with following sample data..

Column headers:

USER_VAR,PASSWORD_VAR,APP1,APP2,APP3

Actual data:

username1,password1,true,blank,blank
username2,password2,true,blank,blank
username3,password3,blank,true,blank
username4,password4,blank,true,blank
username5,password5,blank,blank,true

I have 3 different (independent) JMeter Scripts.

JMeterScript-APP1
JMeterScript-APP2
JMeterScript-APP3

I want to use the same CSV file with all these 3 scripts in such a way that each script only use the specific rows in given CSV.

JMeterScript-APP1 should only process first 2 rows (APP1=true).

JMeterScript-APP2 should only process 3rd and 4th row (APP2=true).

JMeterScript-APP3 should only process 5th row (APP3=true).

I have tried implementing this scenario using CSV dataset config. But it seems that JMeter does not provide any built in support for implementing this. Can anyone share workarounds for doing it?

If required I can also manipulate the data in last 3 columns of CSV before feeding it to JMeter scripts.

1

1 Answers

0
votes

I believe the easiest way is using If Controller where you can check if this or that variable is set like:

${__javaScript(vars.get("APP1") != null,)}

So if ${APP1} variable is not defined underlying samplers will not be executed, this way you will be able to "skip" the unwanted samplers.


vars is a shorthand to JMeterVariables class instance, it provides read/write access to all JMeter Variables in scope.