Forum Discussion
SmartBear_Suppo
12 years agoSmartBear Alumni (Retired)
Hi David,
I believe it's possible to achieve what you want with a Groovy Script.
In order to do that, you must follow these steps:
- Create a TestSuite Custom property (open the testSuite editor and click on the "Custom Properties" at the bottom-left of the screen) called "prop1" for example.
- Create a Groovy Script TestStep just before your request with code similar to this, so you can programmatically set the value of prop1 to the calculated value you want.
- In your Request TestStep, set the value of field ExtendedInfo to ${#TestSuite#prop1}
Now, when you run your TestSuite, the field ExtendedInfo will take whatever value you set to it in the Groovy Script.
Please let us know if this worked for you.
Regards,
Renato
SmartBear Software
I believe it's possible to achieve what you want with a Groovy Script.
In order to do that, you must follow these steps:
- Create a TestSuite Custom property (open the testSuite editor and click on the "Custom Properties" at the bottom-left of the screen) called "prop1" for example.
- Create a Groovy Script TestStep just before your request with code similar to this, so you can programmatically set the value of prop1 to the calculated value you want.
def calculatedValue = 2 // make some calculation here
testRunner.testCase.testSuite.setPropertyValue( "prop1", calculatedValue as String )
def prop1 = context.expand( '${#TestSuite#prop1}' )
log.info( "Set prop1 to $prop1" )
- In your Request TestStep, set the value of field ExtendedInfo to ${#TestSuite#prop1}
Now, when you run your TestSuite, the field ExtendedInfo will take whatever value you set to it in the Groovy Script.
Please let us know if this worked for you.
Regards,
Renato
SmartBear Software
Related Content
- 7 years ago
Recent Discussions
- 15 hours ago
- 17 days ago