Property Expansion and Groovy Script
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2008
06:37 AM
02-27-2008
06:37 AM
Property Expansion and Groovy Script
Hi there,
If I have a property attached to my project called FILE_PATH, can I make a direct reference to it within Groovy script.
${#Project#FILE_PATH}
or do I have to use something like context.getProperty("FILE_PATH")
Finally I would like to know if its possible to make a change to this properties value and then save the change to the project.
Thanks,
Noel
If I have a property attached to my project called FILE_PATH, can I make a direct reference to it within Groovy script.
${#Project#FILE_PATH}
or do I have to use something like context.getProperty("FILE_PATH")
Finally I would like to know if its possible to make a change to this properties value and then save the change to the project.
Thanks,
Noel
4 REPLIES 4
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2008
06:45 AM
02-27-2008
06:45 AM
Hi!
you can either get the property value with
context.expand( '${#Project#FILE_PATH}' )
or get and set the property valuewith
def prop = testRunner.testCase.testSuite.project.properties["FILE_PATH"]
// set
prop.value = ...
If you want to save the project then do
testRunner.testCase.testSuite.project.save()
should do the trick!
Hope this helps!
regards,
/Ole
eviware.com
you can either get the property value with
context.expand( '${#Project#FILE_PATH}' )
or get and set the property valuewith
def prop = testRunner.testCase.testSuite.project.properties["FILE_PATH"]
// set
prop.value = ...
If you want to save the project then do
testRunner.testCase.testSuite.project.save()
should do the trick!
Hope this helps!
regards,
/Ole
eviware.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2008
07:17 AM
02-27-2008
07:17 AM
Hi Ole,
Thank you so much for the quick response.
I can get the prop = context.expand( '${#Project#FILE_PATH}' ) to work but not the def prop = testRunner.testCase.testSuite.project.properties["FILE_PATH"]
This is because I'm running a peice of groovy script from the mock response editor and its not invoked with testrunner.
Is there a way around this?
Thanks,
Noel
Thank you so much for the quick response.
I can get the prop = context.expand( '${#Project#FILE_PATH}' ) to work but not the def prop = testRunner.testCase.testSuite.project.properties["FILE_PATH"]
This is because I'm running a peice of groovy script from the mock response editor and its not invoked with testrunner.
Is there a way around this?
Thanks,
Noel
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2008
07:23 AM
02-27-2008
07:23 AM
Hi,
oh.. sorry.. in that try using
mockResponse.mockOperation.mockService.project.properties["FILE_PATH"]
instead!
regards,
/Ole
eviware.com
oh.. sorry.. in that try using
mockResponse.mockOperation.mockService.project.properties["FILE_PATH"]
instead!
regards,
/Ole
eviware.com
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2008
08:12 AM
02-27-2008
08:12 AM
Hi Ole,
Thanks again for the speedy response, I have it working now.
/Noel
Thanks again for the speedy response, I have it working now.
/Noel

