Access custom properties programmatically ?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2021
08:16 PM
03-02-2021
08:16 PM
Access custom properties programmatically ?
Test cases have custom properties. To access each property inside a groovy script, I have to repeat the this "context.expand( '${TestCase#SomeProperty}" for each property. Is there a shorter way to access such properties? Perhaps like this:
def allProps = context.expand('Get all the properties')
def name = allProps.get('Name')
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2021
05:13 AM
03-04-2021
05:13 AM
Even the sample you posted is doing the same. Isn't it?
For each property, you are calling get method to get the value.
Regards,
Rao.
For each property, you are calling get method to get the value.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2021
02:47 AM
03-05-2021
02:47 AM
Hi @rajs2020 ,
FYI.
testRunner.testCase.propertyList.each {
log.info "name=${it.name}, value=${it.value}"
}
Thanks,
/Aaron
