Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Message is not printing on the console in jmeter using JSR223 and groovy

Tags:

println() inside static void main method is not printing anything anywhere, whereas only println() prints in terminal. Here is my code:

class CalcMain { static void main(def args) throws Exception {     ScriptEngineManager factory = new ScriptEngineManager();     ScriptEngine engine = factory.getEngineByName("groovy");      println("testing");   } } 

And when I ran it shows pass (Green Triangle in Jmeter) but doesnt print anything on terminal

Whereas a simple program such as

println("testing"); 

prints on terminal.

Could someone please let me know where I am doing wrong?

like image 834
Pratik Avatar asked Nov 06 '13 06:11

Pratik


1 Answers

Don't use System.out.println in a Groovy or Beanshell step in jmeter. Instead , do this:

1. Enable the stdout console in Jmeter so that you can see the output. 2. Use  log.info("Message:" + vars.get("variableName"));  instead. 
like image 95
djangofan Avatar answered Sep 29 '22 23:09

djangofan