ContributionsMost RecentMost LikesSolutionsRe: Getting java.lang.NoClassDefFoundError in Ready API it was my mistake I forget to copy one of the dependencies, after coping it it is resolved now thanks Re: Getting java.lang.NoClassDefFoundError in Ready API I tried same copying jar files "C:\Program Files\SmartBear\ReadyAPI-3.3.2\bin\ext" but still running into same issue Getting java.lang.NoClassDefFoundError in Ready API HI all, I have a need where I need to come up with a function which with return a Jason to map Json { "a": { "b": 1, "c": null, "d": [false, true] }, "e": "f", "g": 2.3 } Map Key Value a.b 1 a.c null a.d[0] false a.d[1] true e f g 2.3 This can be done using JsonFlattener jar and was implemented in Eclipse, so added that external Jar in Ready API under “Custom Java libraries” but on executing this function it error out with message “java.lang.NoClassDefFoundError”, can some one please help me how this can be resolved. Below is the code import com.github.wnameless.json.flattener.JsonFlattener; public def func1(def expected){ def resultMap = [ : ]; resultMap = JsonFlattener.flattenAsMap(expected) return resultMap; } SolvedRe: Compare Json Response from the data source with the actual response in event Thanks this solved my problem Re: Compare Json Response from the data source with the actual response in event sonya_m, sorry there was a delay from my end, please find case #00448234 Re: Compare Json Response from the data source with the actual response in event richie Sorry for being late, I had verified Ready API version is 3.3.1, which looks like most updated one. AlsomessageExchange object is still an issue for me I always run into issue with it, can you please provide some sample code for reference. Also as sonya_msuggested will raise ticket with customer care. Re: Compare Json Response from the data source with the actual response in event I Ran into this example but is there something I need to import before using it, because I am always running into issue. // Get a test case property def testCaseProperty = messageExchange.modelItem.testStep.testCase.getPropertyValue( "MyProp" ), Re: Compare Json Response from the data source with the actual response in event Thanks please refer this screenshot,I will also start digging intomessageExchange and see how that will help. Re: Compare Json Response from the data source with the actual response in event Richto re-verify iftestRunner IS available within events or not I went to the tool and find testRunner is missing, please refer below screenshot of events. In case if I am looking into some wrong place please do update me. Re: Compare Json Response from the data source with the actual response in event Thanks Rich please find more details below and in case if I am not clear please let me know I will try to explain more From Implementation structure, I mean at current for my Json request things like updating it with dynamic values, removing empty (key, values, array of empty objects) all are handled with events. For response verification I already have a expected response in the data source there are few dynamics id that’s need to be removed before comparing actual and expected Json response, this is already implemented in a groovy script but instead of adding this groovy script after ever Rest request for me it looks it will be better if this can be handled in events, at current I can get the current response in the events but when I am using same approach as listed below but It didn’t work in event because of unavailability of testrunner in events. def ds = testRunner.testCase.testSteps['DataSource'] def ExpJson = ds.getPropertyValue("ExpectedResponse"); for Assertion point I was thinking of one simple status code assertion in the rest request and other will be JSON response comparison in event, it will use the existing groovy function where input parameter is expected json from datsource and actual one from REST response Below is the sample code I had used in event for request handling. if(request.getName()=="Request1" || request.getName()=="Request2" || request.getName()=="Request3" ){ def requestContent = (String) context.getProperty(BaseHttpRequestTransport.REQUEST_CONTENT) log.info("Request Body BEFORE " + requestContent) def finalrequest = ModifiedRequest(requestContent); log.info("final request is " + finalrequest); log.info("Request Body AFTER " + finalrequest) context.setProperty(BaseHttpRequestTransport.REQUEST_CONTENT, finalrequest); def httpMethod = context.getProperty(BaseHttpRequestTransport.HTTP_METHOD) httpMethod.setEntity(new ByteArrayEntity(finalrequest.getBytes(Charset.defaultCharset()))) }