cancel
Showing results for 
Search instead for 
Did you mean: 

Global Props and Groovy

Highlighted
Occasional Contributor

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 1
Highlighted

Re: Global Props and Groovy

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


 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!