Forum Discussion
groovyguy
8 years agoCommunity Hero
You can use the following property expansion to set a Project level property:
def result = "Whatever your groovy script result is."; context.testCase.testSuite.project.setPropertyValue("PropertyName", result);
- MD018 years agoOccasional Contributor
It did not pass the groovy step result . following is my groovy script and attached is the how i am making it as testSuite custom property. i am doing wrong anywhere?
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def today = new Date() def laterDate = today + 2 def dda = laterDate.format("yyyy-MM-dd") log.info dda def result = dda context.testCase.testSuite.project.setPropertyValue("PropertyName", result);
- groovyguy8 years agoCommunity Hero
I apologize, I misread your post and thought you wanted it at the project level, not the test suite level. Here's a better version for the script you provided.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def today = new Date() def laterDate = today + 2 def dda = laterDate.format("yyyy-MM-dd") log.info dda def result = dda context.testCase.testSuite.setPropertyValue("PropertyName", result);
There's a lot of documentation on Property Expansion here.
Related Content
- 3 years ago
- 10 months ago
Recent Discussions
- 4 hours ago
- 17 days ago