1

I am facing a situation currently, where I have 2 threads inside 1 thread group. Both the threads use different csv's. For this I've put 1 CSV Data Set Config in each thread. Problem is there is a variable called userId which is common in the Variable Names in csv data set config for both. Due to this when the first thread executes it assigns the userId a value which is then carried forward to another thread.

For example,

  • Thread1 >> reads values from csv >> assigns userId=1104.
  • Thread2 >> reads values from csv >> cannot assign userId=1105 but keeps the previous assigned value userId=1104.

I've tried sharing mode as Current Thread but doesn't seems to work in this case.
Please suggest a way out.

4
  • How are you reading a different csv in each thread? Commented May 21, 2013 at 8:54
  • Yes these two threads uses different csv's. Commented May 21, 2013 at 9:05
  • How do you get JMeter to read a different CSV in each thread? I am unaware of a way to do this, so want to know how you had done it. The easiest way is to take a screenshot which shows your CSV Data Set Config item and post it in your question above Commented May 21, 2013 at 9:52
  • I cannot post images due to my reputation here. let me make the scenario more clear.>>> there are 2 samplers. Both contains 1 CSV Data set config each. If the variable names are common in both the sampler's csv data element then the value assigned by the first sampler stays in the next sampler request. I think the confusion is about the threads mentioned above. Replace Thread1 and Thread2 as Sampler1 and Sampler2 kept in same Thread Group. Commented May 21, 2013 at 11:34

1 Answer 1

1

If you have two CSV Data Sets, with the same variable names, at the same level in the Test Plan Tree, you will see the behaviour you describe. If they both have a variable called var1, for example, it will have the same value throughout the level.

You can use the Simple Controller element, so that each CSV Data Set Config is on its own level, and the variable values are not shared.

Simple Controller has no logic, other than grouping other elements together, so all you need to do is create two, and move the other elements beneath it.

BROKEN

enter image description here

WORKS

enter image description here

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

1 Comment

In this case if I have 50 Http request samplers, then I will need 50 Simple Controller element?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.