soapui 5.2.1 test case property reading in mock response scripting: "No such property: testRunner"
When setting and getting a property as shown in the two attachments, the below error occurs.
How can this be solved?
Tue Jun 28 14:58:57 IST 2016: DEBUG:Connection closed
Tue Jun 28 14:59:41 IST 2016: DEBUG:Attempt 1 to execute request
Tue Jun 28 14:59:41 IST 2016: DEBUG: Sending request: POST /rest/dataservices/products/v2/product/search/data HTTP/1.1
Tue Jun 28 14:59:42 IST 2016:ERROR:An error occurred [No such property: testRunner for class: Script2], see error log for details
Tue Jun 28 14:59:42 IST 2016:ERROR:An error occurred [Failed to dispatch using script; groovy.lang.MissingPropertyException: No such property: testRunner for class: Script2], see error log for details
Tue Jun 28 14:59:43 IST 2016: DEBUG:Receiving response: HTTP/1.1 500 Internal Server Error
Tue Jun 28 14:59:43 IST 2016: DEBUG:Connection can be kept alive indefinitely
Tue Jun 28 14:59:43 IST 2016:INFO:Got response for [http://ece: port.Rest:REST Request] in 1702ms (92 bytes)
Tue Jun 28 15:00:17 IST 2016: DEBUG:Connection closed
Hi,
The testRunner variable is not exposed within Mock scripts, there is a mockRunner instead - in other words, mocks can't access properties in that way.
However mocks can access Global properties from within mock scripts e.g.
def globalProperty = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue(
"MyProp"
)
Regards,
Rupert