Sonarqube + Jmeter error in jtl file

回眸只為那壹抹淺笑 提交于 2020-01-06 18:04:16

问题


i install Sonarqube with Jmeter Plugin. I have my simple test in Jmeter with:

Threads group
   Http Sampler
       Assertion Results

and i save the result in local, with jtl extension.

Now i have configure Local jtl file in jmeter plugin for sonar, for my project.

But now if i try to test my project i have this error:

ERROR - Cannot analyse project 'My project'
es.excentia.jmeter.report.server.testresults.JtlReaderException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '1' (code 49) in prolog; expected '<'

回答1:


It looks like that sonarqube expects JMeter result file to be in XML format and by default it is CSV.

Results file output format is controllable via jmeter.save.saveservice.output_format property, supported values are xml and csv, default is csv.

Depending on how you launch your JMeter test the property can be set in different ways:

  1. Add the next line to user.properties file which lives under /bin folder of your JMeter installation

    jmeter.save.saveservice.output_format=xml
    
  2. Look for this property in jmeter.properties file, uncomment and change its value to xml

  3. If you run JMeter in command-line mode the property can be passed via -J argument as

    jmeter -Jjmeter.save.saveservice.output_format=xml -n -t /path/to/your/test/plan.jmx -l /path/to/results/file/jtl
    

See Apache JMeter Properties Customization Guide for comprehensive information on JMeter's property types and ways of overriding.



来源:https://stackoverflow.com/questions/26200512/sonarqube-jmeter-error-in-jtl-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!