Forum Discussion

eissaeva's avatar
3 years ago

Which jar files were added to resolve this?

Hi community,

I run into the same error while using Diff class in groovy ReadyAPI version 3.8.0


def actualResponse = testRunner.runTestStepByName("postQueryWithSFGraphIdAndBlankConstraint").getResponse().getContentAsString()
def expResponse = context.getTestCase().getPropertyValue("gp")


JSONObject parseJsonAct = (JSONObject) new JsonSlurper().parseText(actualResponse);
JSONObject parseJsonExp = (JSONObject) new JsonSlurper().parseText(expResponse);


// Create an object with differences between documents
Diff myDiff = new Diff(parseJsonAct, parseJsonExp)
DetailedDiff diff = new DetailedDiff(myDiff)


I researched and found this post. Just not able to reply and ask which jar files were missing?


My error attached








5 Replies

  • nmrao's avatar
    Champion Level 3
    You can use groovy.json.JsonSluper class. No additional library is needed.
    • eissaeva's avatar

      I am already using it as you can see from the code sample I sent but still getting the error


      These are my imports


      import groovy.json.JsonSlurper;
      import org.json.JSONObject;

      • nmrao's avatar
        Champion Level 3
        Why "import org.json.JSONObject;' is needed?