Skip to content

Instantly share code, notes, and snippets.

@james-jhang
Last active March 20, 2024 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save james-jhang/7ab37d0c1d4ad3ccf0ac4caba2eccd96 to your computer and use it in GitHub Desktop.
Save james-jhang/7ab37d0c1d4ad3ccf0ac4caba2eccd96 to your computer and use it in GitHub Desktop.
Show RobotFramework report on Jenkins

Show RobotFramework report on Jenkins.

Issue: "Opening Robot Framework log failed"

  • Verify that you have JavaScript enabled in your browser.
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.

Explanation: Due to Content Security Policy (https://content-security-policy.com/).

Solution: Change the CSP from Jenkins through script.

  1. Go to https://<jenkins_ip>/script
  2. Type this: System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","sandbox allow-same-origin; allow-scripts; default-src 'none'; img-src 'self' data: ; style-src 'self' 'unsafe-inline' data: ; script-src 'self' 'unsafe-inline' 'unsafe-eval' ;")
  3. Re-login jenkins.

But if you restart jenkins, you need to do this again. To reset the CSP, by doing this: System.clearProperty("hudson.model.DirectoryBrowserSupport.CSP")

@GaborCsizmadia
Copy link

This solution works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment