title: soapUI: How to set lists as property
body: <p>I want to do the following in soapUI using Groovy:</p>
  
  <ol>
  <li>Select random value and correspondating data from database</li>
  <li>Get the response from webservice</li>
  <li>Compare my database data with the response from the webservice</li>
  </ol>
  
  <p>To achieve this I have the following steps definied:</p>
  
  <ol>
  <li>Created property object for the test suite </li>
  <li>Groovy Script to get the random and correspondating values from database </li>
  <li>Transformation to put the random value into the request</li>
  <li>Webservice call to get response</li>
  <li>Groovy Script to compare the values from my database with the response of the webservice</li>
  </ol>
  
  <p>I did the same steps for other tests already by putting the values from database into the property object in step 2 and reading them from there in step 5. But up to now the values were always normal <code>String</code> or <code>int</code>. In the response I get in my current test case I get a list back. So I create an array and filled it with bean objects my wanted data in step 2. In step 5 I parse my XML-String and convert the data into an Object-Array too. So I can compare all attributes of them.</p>
  
  <p>I wrote the whole test case in a singular script and tested it on groovy console first. When I started to transform it to soapUI and working with the property to "transport" the data from step 2 to step 5 my problem occurs as it looks like I can't put an Arraylist to the properties (see error message below).</p>
  
  <p>Now I'm confused that this is not possible as I can easily put SQL-Instances in the properties:</p>
  
  <pre><code>def contextSqlInstanz = Sql.newInstance(urlH2, userH2, passwordH2, driverH2)
  context.setProperty( "contextSqlInstanz", contextSqlInstanz )
  
  sql = context.getProperty("contextSqlInstanz");
  </code></pre>
  
  <p>So how I can transport my Array, filled the Objects, from step 2 to step 5 to compare it with my webservice response. I <strong>DON'T</strong> want to convert both to strings and compare if the strings are equal but I want to compare each attributes of my bean-class by hand.</p>
  
  <p>Bean Class:</p>
  
  <pre><code>class myBean {
  
      String value1;
      String value2;
      ...
  }
  </code></pre>
  
  <p>Reading my local database, generating the beans and put them into a list    </p>
  
  <pre><code>function getdata() {  
    def liste = []
  
    // sql-statements
    sql.eachRow(...) {
  
     def myBean = new myBean();
  
     myBean.value1 = it.value1.toString();
     myBean.value2 =  it.value2.toString();
     ...
  
     liste.add(Schluesselwert)
  
    }
  
    return liste   
  }
  </code></pre>
  
  <p>Trying to put the list into properties</p>
  
  <pre><code>sollListeH2 = getdata()
  
  def props = testRunner.testCase.getTestStepByName("P_testcase")
  props.setPropertyValue( "sollListe", sollListeH2)
  </code></pre>
  
  <p>results in:</p>
  
  <blockquote>
    <p>groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.teststeps.WsdlPropertiesTestStep.setPropertyValue() is applicable for argument types: (java.lang.String, java.util.ArrayList) values: [sollListe, [value1@15d4334, value2@1e739c8, ...]] Possible solutions: setPropertyValue(java.lang.String, java.lang.String), getPropertyValue(java.lang.String) error at line: 91</p>
  </blockquote>