Forum Discussion
I followed your advise but it is not working.I guess I am doing some thing wrong..Can you check the screenshot attached to this thread and please confirm that I am following you correctly..
context.testCase.testSuite.project.testSuites["Services"].testCases[ServiceName].setPropertyValue(inputtagList.getAt(intcount),inputValueList.getAt(intcount))
Finally I am able to do it by going through RestTestRequestStep API class. Thanks for the user in the below link who has directed me to correct API class.
Incase if any one having same problem, below is the solution i have followed to set REST request parameter values through groovy code..
counter =0;
firstTestStep =context.testCase.testSuite.project.testSuites["Services"].testCases[ServiceName].testSteps[methodname]
if(firstTestStep instanceof com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep)
{
/def parameters = firstTestStep?.getTestRequest()?.getParams()
// loop through the map parameters
parameters.each { k,v ->
// for each params print the name and the value
def param1="$k"
log.info param1
log.info "value of k is :$k : ${v.getValue()}"
if (counter<tagsize)
{
parameters.setPropertyValue(param1,inputValueArray[counter])
counter++
}
}
Thanks,
Ravindra.Ch
Related Content
Recent Discussions
- 2 days agogroovyguy