1

I am using jsr223 assertion with groovy script ,I am saving the parsed response as variable

def slurper = new groovy.json.JsonSlurper();
def t1= prev.getResponseDataAsString();

def response = slurper.parseText(t1);
vars.putObject("Summary", response);

Now I want to use this Summary variable in another call, so that I can assert it

def nn = ${SummaryJDBC};

But I am getting this error

jmeter.threads.JMeterThread: Error while processing sampler 'Competitive_Landscape(Past_awardees)' : java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String

4

1 回答 1

0

您应该使用getObject()方法:

 nn = vars.getObject("SummaryJDBC")
于 2017-03-27T13:01:59.760 回答