swety
8 years agoNew Contributor
How pass groovy HashMap via testcase ?
I want to do the following in soapUI using Groovy:
TestCase1:
Select values (Lastname, firstname) from database
Create hashMap with dynamique value
def Map = [Login :"$Login", Nom: "$Nom"]
I need my map to be transferred to another TestCase, for this
i trying to put my Map into properties
> testRunner.testCase.setPropertyValue( "Map", Map)
But i have error:
> groovy.lang.MissingMethodException: No signature of method: > com.eviware.soapui.impl.wsdl.WsdlTestCasePro.setPropertyValue() is > applicable for argument types: (java.lang.String, > java.util.LinkedHashMap) values: [OuvInfoPersoMap, > [Login:dupond0001, Nom:Dupond]] Possible solutions: > setPropertyValue(java.lang.String, java.lang.String), > getPropertyValue(java.lang.String) error at line: 123
I found some posts on internet that suggests to use metaClass groovy property
> context.testCase.metaClass.map = Map log.info context.testCase.map
But I don't think it enough in my case
I would like to be able to pass a map to Testcase2
Testcase2:
> createMap = > testRunner.testCase.testSuite.project.testSuites.testCases["TestCase1"] > createMap.map
Hopefully you can help me solving this problem.
Thanks advance