Forum Discussion

kraju's avatar
12 years ago

LoadUI is not fetching SoapUI property value

Hi,

I am having an integration problem with using LoadUI and SoapUI.

I have a REST SoapUI project that is fetching random number ID's for the REST service end point.

Within the test case of my Rest project, I have a single request with the field name 'ID'. I have also added the below groovy code to generate and set random number ID's between 1-1000 for the request property.

Random random = new Random()
def randNo = "Person Number: "
int max = 990
randnum = random.nextInt(max+10)
randNo += randnum
log.info "$randNo"

def project = context.testCase.testSuite.project
def testSuite = project.getTestSuiteAt(0)
def testCase = testSuite.getTestCaseAt(0)
def testStep = testCase.getTestStepAt(1)

def requestValue = testStep.setPropertyValue("id", String.valueOf(randnum));

When running the single test case manually multiple times from the rest project, according to the log files this works and fetches new distinct persons accordingly.

However here is the problem;

When I have saved and opened the project in LoadUI, it is running the test case in the same instance meaning the same person id is being pushed through rather than new IDs.

For example, in the Rest project if the last person ID was set to '282' then LoadUI will run the test case with ID '282' multiple times rather than generating new person IDs.

I have attached the project.

Any help or thoughts would be much appreciated.

Thanks.
No RepliesBe the first to reply