shthaha01 发表于 2013-1-6 17:45:42

testlink测试用例的图片导不出来

testlink测试用例里加入了上传的图片,现在想要到处或者打印出来word版本的测试用例。
打印测试用例的选项里,HTML板式的可以清楚地看到图片还存在,可以看到;但是导出/打印模式改为MS WORD的时候就发现变成了一个红叉,求大神指点这究竟是怎么回事啊!!!

fengerapple 发表于 2013-1-25 17:32:23

Thank you very much for sharing!The good man!The good life of peace!

taotaole2210 发表于 2013-2-28 17:08:20

参见 http://bbs.51testing.com/thread-886238-1-1.html
根据方法已经解决此问题
可以在testlink\lib\results\printDocument.php中找到“$docText .= renderEOF();”这句。在此句之前加入
####################################################################################
# change relative image paths to absolute image paths
# src="/=> src="http(s)://example.com/
####################################################################################

# fetch protocol and domainname
if($_SERVER["SERVER_PORT"]=='443'){
   $url_host = "https://".$_SERVER["HTTP_HOST"];
}elseif($_SERVER["SERVER_PORT"]=='80'){
   $url_host = "http://".$_SERVER["HTTP_HOST"];
}else{
   $url_host = $_SERVER["HTTP_HOST"].":".$_SERVER["SERVER_PORT"];
}
if(substr($url_host, -1)!='/'){
   $url_host.= '/';
}

$xPattern = "/src=\"\//si";
$xValue = "src=\"".$url_host;
$docText = preg_replace($xPattern, $xValue, $docText);
####################################################################################

可参考http://www.teamst.org/forum/view ... 3583&hilit=word
页: [1]
查看完整版本: testlink测试用例的图片导不出来