Forum Discussion

Pete_H's avatar
Pete_H
Occasional Contributor
16 years ago

Global Props and Groovy

I am trying to do a very simple thing but I'm having trouble:
I have a global property I set up through SoapUI's preferences tool called "username" (File->Preferences, under the Global Properties tab).

What I'd like to do is to be able to read the value of this property via a groovy test step.  From what I've been reading, this should do it (i've wrapped it in a logger.debug statement for debugging purposes)

log.debug "${username}"

But I get a "no such property: username" error when I run the script.

Any help is greatly appreciated

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello!

    Try using the following instead:


    log.debug context.expand('${username}')


    Note that you do have to use single quotes (') for the property expansion to work!

    Regards,
    Dain
    eviware.com