有没有办法在ready API中使用groovy设置自定义属性

有没有办法在ready API中使用groovy设置自定义属性,groovy,ready-api,Groovy,Ready Api,我正在使用groovy从一个API响应中获取“EmployeeID”值。现在,我想使用groovy在自定义属性中设置该值,以便在post API调用中重用它。有没有一种方法可以在ready API或使用groovy脚本中实现这一点?是的,这取决于您希望在哪个级别设置属性 testRunner.testCase.setPropertyValue("my_prop", my_value) // at test case level testRunner.testCase.testSuite.setP

我正在使用groovy从一个API响应中获取“EmployeeID”值。现在,我想使用groovy在自定义属性中设置该值,以便在post API调用中重用它。有没有一种方法可以在ready API或使用groovy脚本中实现这一点?是的,这取决于您希望在哪个级别设置属性

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

请注意,“my_value”必须是字符串,因此您可能需要强制转换它:my_value.toString()

是的,您可以这样做。提供更多关于从何处设置值的详细信息。非常感谢,这正是我想要的。