Does a soapUI runner used with a Virtual User generator only run the specified testCase's setup script once in loadUI?

StackOverflow https://stackoverflow.com/questions/10904748

  •  12-06-2021
  •  | 
  •  

문제

I'm trying to run a load test on a testCase I have created in soapUI using loadUI.

My soapUI testCase has an AMF request in it that creates a database object, lets call it "someList". In the testCase options menu, I have "Enable AMF session" checked with the correct endpoint pasted in.

Now, I'm using the Setup Script feature of the testCase to dynamically set a random login and password in the testCase AMF options like so:

def loginCreds = String.format("%04d", new Random().nextInt(999999999))

testCase.setAmfLogin( loginCreds )

testCase.setAmfPassword( loginCreds )

When I run this testCase in soapUI, the AMF session login and password are randomized correctly and a new user is created in my database and the AMF Request correctly creates "someList" and assigns ownership to the newly created random user (generated through the AMF session login and password options.)

I re-run the test, new user, new "someList". Works just like I want it to.

Now, when I run this in LoadUI as a soapUI Runner with a fixed rate Virtual User generator, only one new user is ever created, and every subsequent new "someList" is assigned to that user. It seems like the setup script is only being run once!

Is this intended functionality!?

The following is an exerpt from http://www.loadui.org/Runners/soapui-runner-component.html

"It's important to note that each Virtual User that passes a soapUI Runner gets its own isolated copy of the soapUI TestCase, but actually shares the rest of the soapUI Project with all other VUs running a soapUI TestCase belonging to the same soapUI Project. This means that you should avoid writing to TestSuite or Project Properties, as they are shared between all VUs and will likely cause a ConcurrentModificationException, if not synchronized."

Am I reading this wrong? Shouldn't each Virtual User get it's own version of the testCase and thus the setup script and it's randomly generated AMF session login and password?

This seems to completly negate the possibility of simulating seperate virtual users, each with their own AMF session credentials, as no one user would be making hundreds of "someList" objects at the same time.

Any help or clarification would be greatly appreciated.

I did some testing of my assumptions and the setup script is run each time, but the AMF Session credentials are shared by all the Virtual Users that are generated.

도움이 되었습니까?

해결책

I had a similar issue with the built-in load test functionality in SoapUI (I never had much luck moving my projects to LoadUI). I finally found a fix by providing a random seed that varied with time, a constant, and the thread index (probably the thread index is the most important part).

def ti = context.ThreadIndex
def cal = Calendar.instance
cal.timeZone = TimeZone.getTimeZone("America/Denver")
cal.set(Calendar.MONTH, Calendar.DECEMBER)
long time = cal.time.time / 1000
def seed = time.toInteger()
Random random = new Random(123445*ti + 544321 + seed)               
def loginCreds = String.format("%04d", random.nextInt( 999999999))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top