Forum Discussion

garlapati99's avatar
garlapati99
Occasional Contributor
8 years ago

How do i get all the elements (with out the values) of a json response in soapui using groovy.

Here is my requirement.

 

I need only the elements of a json response. I dont want its values. I want to achieve this in free version of soapui using groovy. Any advice.

 

Thanks

4 Replies

    • garlapati99's avatar
      garlapati99
      Occasional Contributor

      Hi Rao,

       

      Here is my JSON Response

       

      {
      "base": "SGD",
      "date": "2017-01-20",
      "rates": {
      "AUD": 0.92874,
      "BGN": 1.2869,
      "BRL": 2.2356,
      "CAD": 0.93545,
      "CHF": 0.70582,
      "CNY": 4.8115,
      "CZK": 17.779,
      "DKK": 4.8927,
      "GBP": 0.56978,
      "HKD": 5.4275,
      "HRK": 4.9457,
      "HUF": 203.38,
      "IDR": 9381.5,
      "ILS": 2.6648,
      "INR": 47.692,
      "JPY": 80.583,
      "KRW": 822.94,
      "MXN": 15.377,
      "MYR": 3.1113,
      "NOK": 5.9212,
      "NZD": 0.9798,
      "PHP": 35.015,
      "PLN": 2.8753,
      "RON": 2.957,
      "RUB": 41.853,
      "SEK": 6.2556,
      "THB": 24.793,
      "TRY": 2.6757,
      "USD": 0.69957,
      "ZAR": 9.5309,
      "EUR": 0.65798
      }
      }

       

      Thanks,

      Kalyan

      • nmrao's avatar
        nmrao
        Champion Level 3
        So do you want the keys of "rates"? what is your use case? What do you do after finding the keys?