Forum Discussion

rcmcdonough's avatar
rcmcdonough
New Contributor
13 years ago

groovy get global properties

Hi,

I am definitely a newbie...both at soapui and groovy. I have searched the forums and have not found an answer to my problem. I am trying to get the value of a global property via a groovy script. I am able to get custom project properties, but not global properties. Below is the call I use to get the project properties and verify it:

log.info("VerificationIP: " + testRunner.testCase.testSuite.project.getPropertyValue("VerificationIP"))


I was hoping the
log.info("VerificationIP: " + context.getProperty("VerificationIP"))

would grab have it when only setting it via a global prop setting, but that returns null when the prop is set as global and is not set a project prop.

I want to define global properties and pull them back. When I try to define the property above (VerificationIP) as a global prop (and not have in defined in the project), I have no problem setting it and using in soapui TestSteps

I know this is probably a simple newbie problem and your help is greatly appreciated.

Rhonda

2 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    You can access a global property like this:

    def verificationIP = context.expand('${#Global#VerificationIP}')