Forum Discussion

akashreuben7's avatar
New Contributor
5 years ago

String with two variables failing

I have two questions


String asdf = ['B','S']
String qwer = ['B']
def result = getExpectedResult(asdf, qwer) result


Its failing

am expecting it takes something like getExpectedResult(['B','S'], ['B']). How to achieve



am getting outputs from database like 






and so on ...

All these results are generated in a loop.

How to achieve as








2 Replies

  • JHunt's avatar
    Community Hero



    Your question isn't really a SoapUI one, and may be more suitable for a site like that has a Groovy specific section.


    (I don't mind answering some Groovy questions here, but can only do so when they are well formulated.)

    • akashreuben7's avatar
      New Contributor

      def asdf = ["B","S"]
      def qwer = ["B"] asdf
      String result = getExpectedResult(asdf,qwer) result


      public String getExpectedResult(def dbList, def inputCom)
      def masterSet = [A:'A',B:'BS',C:'CDE']
      def status= "true"
      for(e in inputCom){
      masterValOfCom = masterSet[e] masterValOfCom
      return status
      return status


      The above returns true which is good.


      Now I have list of values coming from the loop as for asdf as 




      and so on.. 

      and values for qwer are [A],[B],[C]

      now hyow to insert these asdf and qwer in getExpectedResult

      because now I use the above code its throwing me error stating MissingPropertyException