Forum Discussion

Awesome's avatar
Awesome
Frequent Contributor
16 years ago

how to get property name

how do you get the name of a property?

so property expansion to get the value is:
def values_in_tigers = context.expand( '${#Project#Tigers}' )

but how do i do something like:

def names_of_tigers = context.expand( '${#Project#Tiger.NAME}' )

i know this seems redundant since i'm trying to get it to return "Tiger"... but i want to access both the name and value of the property list...

thanks!

1 Reply

  • Hi!

    you can't get this via property-expansion, use the standard API instead;

    def project = testRunner.testCase.testSuite.project

    for( a in project.propertyNames )
    {
    log.info "$a = " + project.getPropertyValue( a )
    }


    Does that work ok?

    regards!

    /Ole
    eviware.com