Forum Discussion

HaroldR's avatar
HaroldR
Contributor
7 years ago
Solved

Iterate throw global properties entries from Groovy script

Hello all,

I have filled some global properties with associated values inside global Propeties section in preferences panel of Ready Api! (Cf attachment)
Now, I would like to know how could I define a list container to iterate through all elements. I would be able to retrieve keys and values from the global properties list in order to do some stuff with each element.

Any idea of how to do this?

  • HaroldR,

    Here you go:

     

    def gp = com.eviware.soapui.SoapUI.globalProperties
    gp.keySet().each { key -> log.info "Property details : $key and ${gp[key].value}" }

     

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    HaroldR,

    Here you go:

     

    def gp = com.eviware.soapui.SoapUI.globalProperties
    gp.keySet().each { key -> log.info "Property details : $key and ${gp[key].value}" }