zoukankan      html  css  js  c++  java
  • 解决在jenkins中无法打开robot framework report.html log.html的问题

    问题描述:

    Opening Robot Framework report 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.

       

    来自 <http://localhost:8080/job/robot%E6%B5%8B%E8%AF%95/8/robot/report/report.html>

       

       

    之前,用的还好好的,为什么现在的报告(reporter.html,log.html)打不开了呢?

       

    出现这个问题的原因是:你升级了jenkins造成的。据官方说明:

       

    Jenkins 1.641 / Jenkins 1.625.3 introduce the Content-Security-Policy header to static files served by Jenkins (specifically, DirectoryBrowserSupport). This header is set to a very restrictive default set of permissions to protect Jenkins users from malicious HTML/JS files in workspaces, /userContent, or archived artifacts.

    jenkins增加的内容安全策略,默认情况下,是禁止执行javascript,css等资源的。

       

    那么如何解决呢?

       

    找到jenkins的安装目录下的jenkins.xml,修改此文件

    修改前

       

    <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%jenkins.war" --httpPort=8080</arguments>

       

    修改后

       

    <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline';" -jar "%BASE%jenkins.war" --httpPort=8080</arguments>

       

    一定要重启jenkins,最好能再执行一下测试脚本,让它生成新的报告文件就行了。

       

    参考链接:

       

    https://groups.google.com/forum/#!msg/concordion/RSp92D2CNuc/nwYW4yqvEQAJ

    https://kb.froglogic.com/display/KB/Content+Security+Policy+(CSP)+for+Web+Report

       

  • 相关阅读:
    python函数对象
    生成器表达式,列表推导式
    python转换excel成py文件
    Python处理excel表
    Go基础:接口相关
    JAVA03-输入和输出
    python6-while循环
    python5-字典
    自动化8-xpath
    网络学习day1-计算机网络基础
  • 原文地址:https://www.cnblogs.com/bull_think/p/6623426.html
Copyright © 2011-2022 走看看