title: Using JMeter, how to compare table data with JSON data?
body: <p>I've got a task to compare all data fetched from postgreSQL table and all data located on a website that uses REST API (HTTP request with JSON data) in order to see which is missing.</p>
  
  <p>I fetch data from postgreSQL using JDBC request (SELECT * FROM exampleTable), data is in standard SQL table format.</p>
  
  <p>And I get REST API data using HTTP request sampler, data is in JSON format:</p>
  
  <p>{"records":[{"id":"rec6iT8M0YFZc9kxf","fields":{"Birthday":"2010-09-01","Gender":"Female","Currently In Pasture":["rec7hRbjrgTaKWdCs"],"Breed":"Jersey","Weight":1800,"Name":"Jerri","Attachments":[{"id":"attbz","url":"<a href="https://IaGSYtK8SlS.jpg" rel="nofollow noreferrer">https://IaGSYtK8SlS.jpg</a>","filename":"Jersey_cow.jpg","size":1555316,"type":"image/jpeg","thumbnails":{"small":{"url":"<a href="https://_Jersey_cow.jpg" rel="nofollow noreferrer">https://_Jersey_cow.jpg</a>","width":27,"height":36},"large":{"url":"<a href="https://dl/S4tl79.jpg" rel="nofollow noreferrer">https://dl/S4tl79.jpg</a>","width":256,"height":341}}}]}</p>
  
  <p>etc etc</p>
  
  <p>both requests should have the same format of data (same "columns" for comparison > name, gender, breed, weight, etc)</p>
  
  <p>I've tried using JSON Extractor post processor element to get individual variables from HTTP response and compare them to individual variables from JDBC request using the Response Assertion element but with no luck</p>
  
  <p>I either get this error: Assertion failure message: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String (probably cause I am using the whole SQL data set instead of data from individual columns)</p>
  
  <p>or something like: 
  Assertion failure message: Test failed: text expected to match /${gender}/</p>
  
  <p>I dont know how to successfully assign variables to data from SQL table and JSON response and then matching those variable values (seeing which entries are absent from what REST API fetches) </p>
  
  <p>is there any easy way to do this using jmeter GUI and not having to rely on beanshell/groovy or any other kind of scripting (so just by using the elements available in jmeter) ?</p>
  
  <p>thank you!</p>