roko98
12 years agoNew Contributor
Changing property inside loadtest from mockservice
Hi all
I'm very new to soapUI, so please forgive if I'm missing something (... or everything!). I have a testcase that use several HTTP and one groovy teststep. The purpose of the groovy TS is to pool for a property change, like this:
And, I have a mockservice, which change the property inside the onRequest script, like this:
This works just fine when I run the testcase manualy. Now, I want to do exactly the same, but with loadtest. I can pass ${ThreadIndex} to the webserver and get it back in the mockservice. This way the mockservice knows "who" is specting the response ... but how can I obtain the right "object" inside the loadtest to set the property to ? There is another way to accomplish the same result ? Any help would be greatly appreciated.
I'm very new to soapUI, so please forgive if I'm missing something (... or everything!). I have a testcase that use several HTTP and one groovy teststep. The purpose of the groovy TS is to pool for a property change, like this:
def time = 30;
while ( testRunner.testCase.getPropertyValue( "arg1" ) != "arg1" ) {
Thread.sleep(1000)
if ( 0 >= time--) {
testRunner.fail("timeout")
break
}
}
And, I have a mockservice, which change the property inside the onRequest script, like this:
def project = mockRunner.mockService.project
def testCase = project.testSuites["TestSuite 1"].testCases["TestCase 1"]
testCase.setPropertyValue( "arg1", mockRequest.httpRequest.getParameter( "arg1" ) )
This works just fine when I run the testcase manualy. Now, I want to do exactly the same, but with loadtest. I can pass ${ThreadIndex} to the webserver and get it back in the mockservice. This way the mockservice knows "who" is specting the response ... but how can I obtain the right "object" inside the loadtest to set the property to ? There is another way to accomplish the same result ? Any help would be greatly appreciated.