Forum Discussion

MistaWizard's avatar
MistaWizard
Occasional Contributor
7 years ago

no such property: testRequest in a teardown script

My teardown script sits at test case level but i'm getting this error in the log ":ERROR:groovy.lang.MissingPropertyException: No such property: testRequest for class: com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep"

 

This is odd because it writes the first request and resposne to a property and bombs afterwards. Please help? Did i import the right stuff?

 

import com.eviware.soapui.model.iface.MessageExchange
import com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep
testRunner.results.each{ testStepResult -> testRunner.testCase.setPropertyValue("${testStepResult.testStep.name}_timeStamp","${testStepResult.timeStamp}")}
testRunner.results.each{ testStepResult -> testRunner.testCase.setPropertyValue("${testStepResult.testStep.name}_timeTaken","${testStepResult.timeTaken}")}
testRunner.results.each{ testStepResult -> testRunner.testCase.setPropertyValue("${testStepResult.testStep.name}_status","${testStepResult.status}")}
testRunner.results.each{ testStepResult ->
def step = "${testStepResult.testStep.name}"
def response = "\${${step}#Response}"
def request = new String(testRunner.testCase.getTestStepByName("$step").testRequest.messageExchange.rawRequestData)
testRunner.testCase.setPropertyValue("${testStepResult.testStep.name}_response",context.expand(response))
testRunner.testCase.setPropertyValue("${testStepResult.testStep.name}_request",request)
}

 

I've used the context.expand method on request but a) this doesn't work for REST requests as rawrequest custom property is always blank and subsequently b) using getPropertyValue("RawRequest") is always blank

 

Please help,

many thanks

1 Reply