Forum Discussion
SmartBear_Suppo
Alumni
14 years agoHi!
Here you are getting and increasing a property value.
There are two problems with this:
Concurrency is complicated and very complex to script yourself.
I would use a DataSource TestStep set to shared instead. That will take care of all concurrency issues automatically, and that is how we have intended users to approach these kind of problems.
Hope this helps!
Henrik
SmartBear Software
abuadam97 wrote: scounter = props.getPropertyValue('COUNTER');
icounter = scounter.toInteger();
icounter++
Here you are getting and increasing a property value.
There are two problems with this:
- loadUI will create a copy each of the TestCase to all threads that are running this simultaneously. This means that the COUNTER property always will be what it was set to originally.
- Even if the threads would share this property, you'd have to do the operation on COUNTER as one atomic transaction to avoid concurrency issues.
Concurrency is complicated and very complex to script yourself.
I would use a DataSource TestStep set to shared instead. That will take care of all concurrency issues automatically, and that is how we have intended users to approach these kind of problems.
Hope this helps!
Henrik
SmartBear Software