jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srikrishna Dandamraju <skdandamr...@gmail.com>
Subject error .jmeter.samplers.SampleResult;
Date Tue, 29 Mar 2016 09:09:52 GMT
hi all

i am getting below error  for bean shell assertion issue,

Assertion failure message: org.apache.jorphan.util.JMeterException: Error
invoking bsh method: eval Sourced file: inline evaluation of: ``import
org.apache.jmeter.samplers.SampleResult; import org.apache.jmeter.threads .
. . '' : Typed variable declaration : Object constructor.

i am trying to copy response in to a csv file
with below  bean  shell assertion code

import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.threads.JMeterContext;
import org.apache.jmeter.threads.JMeterContextService;

SampleResult
previousResult=JMeterContextService.getContext().getPreviousResult();
previousResult.setSampleLabel(previousResult.getSampleLabel() + "_" +
vars.get("comny_id_#") + "-Rows");

if(Integer.parseInt(vars.get("stopLooping")) == 3)
{
  vars.put("stopAsking", "true");
  Failure = true;
  FailureMessage = "Dont received data";
}

if(vars.get("comny_id_#") != null &&
Integer.parseInt(vars.get("comny_id_#")) != 0)
{
  vars.put("stopAsking","true");
  FileOutputStream outPath = new
FileOutputStream(vars.get("pathtoinputdata") + "comny_id_year.csv");
  PrintStream outFile = new PrintStream(outPath);

  int iterMax = Integer.parseInt(vars.get("comny_id_#"));
  for(int i = 1; i <= iterMax; i++)
    outFile.println(vars.get("comny_id_" + i.toString()) + "," +
vars.get("year_" + i.toString()));

  outPath.close();
  outFile.close();
}

help me as asap.

Thanks
Srikrishna.D

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message