Forum Discussion

ITAbteilung's avatar
ITAbteilung
Contributor
14 years ago

[Resolved] Transfering Data from MockupScript to TestCase

Hi,

I have got a mockup that runs a script, which runs a Testcase. This Testcase has to operate with some variables produced in the Mockup-Script, so I need to transfer the variables from the Mockup-Script to the Testcase. The way I do it is:
Mockup script:

def testCase = mockResponse.mockOperation.mockService.project.testSuites["TS1"].testCases["TC1"];
testCase.setPropertyValue( "orderId", arg_orderId);
testCase.run( new com.eviware.soapui.support.types.StringToObjectMap(), true);

Script inside of the TestCase:

def orderId = testRunner.testCase.getPropertyValue( "orderId");

That works fine with simple Datatypes. The problem now is that i need to transfer more complex data like an ArrayList ( or a Groovy List). When I try that i get that errormessage:

java.lang.Exception: No signature of method: com.eviware.soapui.impl.wsdl.WsdlTestCasePro.setPropertyValue() is applicable for argument types: (java.lang.String, java.util.ArrayList) values: [id, [abc, def]]
Possible solutions: setPropertyValue(java.lang.String, java.lang.String), getPropertyValue(java.lang.String)


What's the way to go?

Sincerely,
Pat

3 Replies

  • Hi Pat,

    try saving these objects in the StringToObjectMap that you are passing to the run method of the TestCase - they should then be available in the context object made available to all scripts during execution of the TestCase..

    Does that help?

    regards!

    /Ole
    SmartBear Software