質問

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.

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top