Forum Discussion
SmartBear_Suppo
15 years agoSmartBear Alumni (Retired)
Hello,
Each script will run as a separate Script object, so that synchronization won't work. Instead each script should synchronize on a shared object. Try this instead:
Add a Setup Script to the LoadTest containing this:
Then, modify your Groovy Script to the following:
This should work as intended. Good luck!
Regards,
Dain
eviware.com
Each script will run as a separate Script object, so that synchronization won't work. Instead each script should synchronize on a shared object. Try this instead:
Add a Setup Script to the LoadTest containing this:
context.lock = new Object()
Then, modify your Groovy Script to the following:
//The method itself is not synchronized
def String callLogin()
{
//Use the shared object created in the Setup Script for synchronization
synchronized(context.LoadTestContext.lock)
{
log.info 'Login inside'
...
}
}
This should work as intended. Good luck!
Regards,
Dain
eviware.com
Related Content
- 6 years ago
Recent Discussions
- 19 hours ago