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

后端 未结 5 1546
忘掉有多难
忘掉有多难 2021-01-04 00:19

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

class Ca         


        
5条回答
  •  情歌与酒
    2021-01-04 01:04

    Use below to display text in JMeter Response Tab in "Results Tree":

    SampleResult.setResponseData("Document: " + variable,"UTF-8");
    

    Use below to log in the console text area of JMeter:

    log.info("hello");
    

    A 3rd option is to use Java standard:

    System.out.println("Any String");
    

    Above can be written from any Java/Groovy/JSR223 sampler. But it will be printed on the Parent CMD window that opened the JMeter UI in windows.

提交回复
热议问题