0

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 '<'
FelasDroid
  • 623
  • 3
  • 10
  • 26
  • Hi, Were you able to publish your PERF Jmeter results in Sonar? What version of SonarQube you are using? Im now getting the jtl file in XML format as per Dmitri's answer and the error message is gone but still NOT SonarQube 5.1 is not able to publish the data using JMeter widget in a project's dashboard in Sonar. – AKS Nov 10 '15 at 17:14

1 Answers1

2

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.

AKS
  • 16,482
  • 43
  • 166
  • 258
Dmitri T
  • 159,985
  • 5
  • 83
  • 133