title: SOAP UI: Comparing JSON Response Array with JDBC XMLresponse
body: <p>I have a REST service which will give a <strong>JSON response array</strong> as below and I want to compare the API response with the JDBC XML response to make sure the data is corrent in the API response</p>
  
  <p>[{ "id": 1, "first_name": "George", "last_name": "Bluth", "avatar": "Test1" },<br>
  { "id": 2, "first_name": "Janet", "last_name": "Weaver", "avatar": "Test2" },<br>
  { "id": 3, "first_name": "Emma", "last_name": "Wong", "avatar": "Test3" }]</p>
  
  <p>I have connected the respected data source in the same Test Step in SOAP UI. Here is my sample JDBC Response from the Data source in XML format</p>
  
  <pre><code>&lt;Results&gt;
      &lt;ResultSet FetchSize="10"&gt;
          &lt;Row rowNumber="1"&gt;
              &lt;id&gt;1&lt;/id&gt;
              &lt;first_name&gt;George&lt;/first_name&gt;
              &lt;last_name&gt;Bluth&lt;/last_name&gt;
              &lt;avatar&gt;Test1&lt;/avatar&gt;
          &lt;/Row&gt;
          &lt;Row rowNumber="2"&gt;
              &lt;id&gt;1&lt;/id&gt;
              &lt;first_name&gt;Janet&lt;/first_name&gt;
              &lt;last_name&gt;Weaver&lt;/last_name&gt;
              &lt;avatar&gt;Test2&lt;/avatar&gt;'
          &lt;/Row&gt;
              .
              .
              .
  &lt;/Results&gt;
  </code></pre>
  
  <p>Can anyone tell me how to compare each objects in the array with the corresponding data source value.</p>
  
  <p>I tried make a groovy script to parse the JSON response to a variable using JsonSlurper. However, i am getting error </p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>def responseContent = testRunner.testCase.testSteps["Neme fof the test step"].testRequest.response.contentAsString
  def Response = new JsonSlurper().parseText(responseContent)
  log.info Code
  </code></pre>
  
  <blockquote>
    <p><strong>Error Message:</strong> Unable to determine the current character, it is not a string, number, array, or object The current character read is ''
    with an int value of 65279 Unable to determine the current character,
    it is not a string, number, array, or object line number 1 index
    number 0</p>
  </blockquote>