kulya / jmeter-gradle-plugin

Other
40 stars 27 forks source link

HTML report, jmeter-report error #45

Open staleks opened 9 years ago

staleks commented 9 years ago

Hi,

I've added simple JMeter test (Testing 200 HTTP Status Code check on Google page).

Test is executed, I have xml as report 1428666959184,194,HTTP Request,200,OK,Thread Group 1-1,text,true,18786,1,1,176

But just before finishing Gradle task there is an error that I can see:

:jmeterRun
file:///home/astoisavljevic/work-home/gradle-jmeter/workspace/gradle-jmeter/build/jmeter-report/google-homepage.jmx-20150410-1355.xml; Line #1; Column #1; Content is not allowed in prolog.

BUILD SUCCESSFUL

Total time: 9.054 secs

When I try to examine file: google-homepage.jmx-20150410-1355-report.html

it is empty.

Can you please put some light on this problem?

Maybe I am doing something wrong?

Thnx

foragerr commented 9 years ago

Can you show your results xml file please? is it in XML format?

staleks commented 9 years ago

You might be right, it can be the problem.

Here is the content of "XML file"

1428666959184,194,HTTP Request,200,OK,Thread Group 1-1,text,true,18786,1,1,176

As you can see it is CSV :)

Further more, I've put this project in GitHub, so you can also see for yourself: https://github.com/staleks/gradle-jmeter-example

foragerr commented 9 years ago

https://github.com/staleks/gradle-jmeter-example/blob/master/src/test/jmeter/google-homepage.jmx#L77

Check the "save as xml" checkbox in your listener configuration.

staleks commented 9 years ago

I've changed that checkbox as you stated, but problem still persists:

astoisavljevic@astoisavljevic-laptop:~/work-home/gradle-jmeter/workspace/gradle-jmeter$ ./gradlew jmeterRun
> Building 0% > :jmeterRunCreating summariser <summary>
Created the tree successfully using /home/astoisavljevic/work-home/gradle-jmeter/workspace/gradle-jmeter/src/test/jmeter/google-homepage.jmx
Starting the test @ Fri Apr 10 20:29:35 CEST 2015 (1428690575612)
Waiting for possible shutdown message on port 4445
summary =      1 in     1s =    1.7/s Avg:   234 Min:   234 Max:   234 Err:     0 (0.00%)
Tidying up ...    @ Fri Apr 10 20:29:36 CEST 2015 (1428690576893)
... end of run
:jmeterRun
file:///home/astoisavljevic/work-home/gradle-jmeter/workspace/gradle-jmeter/build/jmeter-report/google-homepage.jmx-20150410-2029.xml; Line #1; Column #1; Content is not allowed in prolog.

BUILD SUCCESSFUL

Total time: 7.634 secs
astoisavljevic@astoisavljevic-laptop:~/work-home/gradle-jmeter/workspace/gradle-jmeter$ 

Check test now in master branch :(

foragerr commented 9 years ago

Hmm, seems to be a defect in the plugin. I cant find where log format is being set to CSV, because jmeter default is XML. If you need a workaround, add this line to your jmeter.properties:

jmeter.save.saveservice.output_format=xml
staleks commented 9 years ago

Yes.

I've tried this solution and it works.

You may close this ticket.