ravienu
4 years agoOccasional Contributor
passing result or variable value from Groovy to test step
Dear Team, I have query below to achieve one of the requirements. I am using ReadyAPI with proper license. I would like to pass Goovy script result as one request body(XML/JSON) parameter for AP...
- 4 years agoGroovy Script test step is not needed. It can done in the request step itself as shown in the below thread.
Please refer an existing solution.
https://community.smartbear.com/t5/API-Functional-Security-Testing/Ready-API-3-3-1-messed-date-up/m-p/205251#M46876 - 4 years agoSave the value into custom property, say EMPLOYEE_ID by adding below line to the script
context.testCase.setPropertyValue('EMPLOYEE_ID', employeeNumber.toString())
Now, in the request, use as ${#TestCase#EMPLOYEE_ID}
Of course, one can save the property at test suite, project level as well. For that respective changes have to done in both groovy and request. - 4 years agoHere is the more detailed information from documentation regarding the same
https://www.soapui.org/docs/scripting-and-properties/property-expansion/
https://www.soapui.org/docs/scripting-and-properties/tips-tricks/