I am getting 'EmployeeID' Value from one of my API Response using groovy. Now i want to set that value in custom properties using groovy so that i can reuse it in my post API Calls. Is there a way we can achieve this in ready API or using groovy script
Asked
Active
Viewed 1,043 times
0
-
Yes you can do that. Provide more details on from where you want to set the value. – Rao Nov 08 '18 at 06:18
1 Answers
2
Yes you can, it depends at which level you want to set your property
testRunner.testCase.setPropertyValue("my_prop", my_value) // at test case level
testRunner.testCase.testSuite.setPropertyValue("my_prop", my_value) // at test suite level
testRunner.testCase.testSuite.project.setPropertyValue("my_prop", my_value) // at project level
note that "my_value" must be a string, so you may need to cast it : my_value.toString()

A.Joly
- 2,317
- 2
- 20
- 25