Reputation: 644
I have TestCase under a TestSuite step in the project. Inside test case, there are Properties test step and Groovy script test step.
Properties step, I added a property like Pro_Response and default value as Nothing
Similarly, I used the following groovy script for assigning a string value to the property and then it shows the string in the log.
String testString = "TestString"
testRunner.testCase.setPropertyValue( "Pro_Response", testString )
def getLocalPropValue = testRunner.testCase.getPropertyValue("Pro_Response")
log.info(getLocalPropValue)
Question: Why the string value is not updating in the property step which I added under the test case even the same property name (i.e. Pro_Response) is used in the script for assigning?
Please refer the screenshot for your reference:
Thanks,
Karunagara Pandi
Upvotes: 1
Views: 336
Reputation: 10329
You have added a "Properties" Test Step, but your script is updating a property in the Test Case. Update your script to:
testRunner.testCase.testSteps["Properties"].setPropertyValue( "Pro_Response", testString )
Upvotes: 1