Forum Discussion

WishMarine's avatar
WishMarine
New Contributor
14 years ago

How do I read global preferences in a Script Assertion?

How do I read global preferences in a Script Assertion?
http://www.soapui.org/Scripting-Propert ... ricks.html shows "def globalProperty = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "MyProp" )".
But this results in an error "No such property: com for class: Script3".

Something like "def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)" doesn't result in an error.

Probably related to my lack of Groovy skills.
  • I get the exact same result. I don't have any problem at all reading Project, Suite, or TestCase properties. I just get a "null" when I try to get the Global property as documented in the documentation. I tried this, and it didn't make a difference:

    import static com.eviware.soapui.SoapUI.globalProperties
    def globalHostPort = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "suite.endpoint" )
    assert globalHostPort != null