简体   繁体   中英

Jmeter Dashboard empty on Jenkins HTML report publish

I'm successfully generating a jmeter dashboard through maven jmeter plug in. I have this build configured on Jenkins to run and it also generates the dashboard successfully with all graphs/data showing. I now try to publish this dashboard with the HTML publisher so it can be accessed from the Jenkins build. The plugin works correctly and moves the generated dashboard with all necessary folders/files to the archive location and displays a link on the build page to the index.html.

If I click that link however it opens the index page but everything is empty...just showing the headings/navigation eg: Empty dashboard through jenkins . If I open the exact same dashboard index page through the build server machine it displays fine and everything shows up and works.

I've added the following to jenkins.xml in hopes it is a css etc. permission issue:

-Dhudson.model.DirectoryBrowserSupport.CSP=

But that did not do anything.

Any ideas why the jmeter dashboard report might not be displaying correctly through Jenkins but does when access directly through the server? As a side note, I'm also publishing jacoco and surefire reports the exact same way and they display fine. I'm also using the performance plug in and that also pulls the data and shows some graphs from jmeter as well...but I'd like the nice dashboard to work, too.

Thanks!

To solve this, go to Manage Jenkins, Script Console section and type this command:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

Press Run. After that run your build again and now you should be able to see generated dashboard...

I had the same issue, that the dasboard of the jMeter-report was empty while accessing the dasboard unsing Firefox. While using Internet-Explorer and Chrome, the report was visible.

The solution and problem was, that we accessed the html-report using the ip adress of the jenkins-server and not the fqdn. After using the fqdn the report was accessible with Firefox as well.

For autostart create a Groovy script file $JENKINS_HOME/init.groovy , or any .groovy file in the directory $JENKINS_HOME/init.groovy.d/ with the following content:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts; default-src 'self'; img-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline';")

systemctl restart jenkins

https://wiki.jenkins.io/display/JENKINS/Post-initialization+script

I had a different issue. I was only able to see the report results when I downloaded the entire zip directory file from the Jenkins artifact page and unzip on my windows workstation. The report showed all of the data.

Thanks below worked

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM