亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-99久久99久久-99久久99久久精品国产

您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Selenium之報(bào)告生成
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時(shí)間:[ 2016/6/23 15:08:53 ] 推薦標(biāo)簽:Selenium 函數(shù)

  一般我們寫的腳本可能覆蓋了較多的測試項(xiàng),而且可能持續(xù)運(yùn)行了一段時(shí)間,本文將教各位實(shí)現(xiàn)在執(zhí)行完自動化腳本后自動生成一份美化報(bào)告
  自動生成報(bào)告類
  話不多說,直接上代碼,代碼中會有詳細(xì)注釋:
  程序清單1:
  package ts.dw.logic;
  import java.io.BufferedWriter;
  import java.io.FileWriter;
  import java.text.DateFormat;
  import java.text.SimpleDateFormat;
  import java.util.Calendar;
  import java.util.GregorianCalendar;
  public class HTMLLOG {
  static GregorianCalendar time = new GregorianCalendar(); 
  public static String filePath = "";
  public static String reportGenerated = "";
  //寫入HTML
  public void generateReport()throws Exception{
  reportGenerated="true"; 
  DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
  Calendar cal = Calendar.getInstance();
  String timeStamp=dateFormat.format(cal.getTime());
  //String path = System.getProperty("user.dir")+"log";
  filePath = "log\"+"Regression_Result-"+"-"+timeStamp+".html";
  FileWriter fstream = new FileWriter(filePath);
  System.out.println("Report's FileName: "+filePath);
  BufferedWriter out = new BufferedWriter(fstream);
  out.write("<html>");
  out.write("<head>");
  //out.write("<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />");
  out.write("<style type='text/css'> "
  + " #summary"
  + " {"
  + " font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;"
  + " width:;"
  + " border-collapse:collapse;"
  + " }"
  + " #summary td, #summary th"
  + " {"
  + " font-size:0.8em;"
  + " border:1px solid #98bf21;"
  + " padding:3px 7px 2px 7px;"
  + " }"
  + " #summary th"
  + " {"
  + " font-size:1.0em;"
  + " text-align:left;"
  + " padding-top:5px;"
  + " padding-bottom:4px;"
  + " background-color:#A7C942;"
  + " color:#ffffff;"
  + " }"
  + " #componentWiseSummary"
  + " {"
  + " font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;"
  + " width:;"
  + " border-collapse:collapse;"
  + " }"
  + " #summary td, #summary th"
  + " {"
  + " font-size:0.8em;"
  + " border:1px solid #98bf21;"
  + " padding:3px 7px 2px 7px;"
  + " }"
  + " #summary th"
  + " {"
  + " font-size:1.0em;"
  + " text-align:left;"
  + " padding-top:5px;"
  + " padding-bottom:4px;"
  + " background-color:#A7C942;"
  + " color:#ffffff;"
  + " }"
  + " #customers"
  + " {"
  + " font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;"
  + " width:;"
  + " border-collapse:collapse;"
  + " }"
  + " #customers td, #customers th"
  + " {"
  + " font-size:0.8em;"
  + " border:1px solid #98bf21;"
  + " padding:3px 7px 2px 7px;"
  + " }"
  + " #customers th"
  + " {"
  + " font-size:1.1em;"
  + " text-align:left;"
  + " padding-top:5px;"
  + " padding-bottom:4px;"
  + " background-color:#A7C942;"
  + " color:#ffffff;"
  + " }"
  + " #customers tr.alt td"
  + " {"
  + " color:#000000;"
  + " background-color:#EAF2D3;"
  + " }"
  + " </style>");
  out.write("</head>");
  out.write("<body text-align:center>");
  out.write("<table width= border=0 cellpadding=2 cellspacing=2>");
  out.write("<tbody>");
  out.write("<tr>");
  out.write("<td>");
  out.write("<table width= border=0 cellpadding=2 cellspacing=2>");
  out.write("<tbody>");
  out.write("<tr>");
  out.write("<td align=center><p class=title><h1>自動化測試報(bào)告-By Kiven</h1></p></td></tr>");
  out.write("</tr>" + "</tbody>" + "</table>" + "<br>");
  /**
  * Creating tables in HTML for Test Status
  */   
  out.write("<table id="customers">");
  out.write("<tr>");
  out.write("<th>Test Case Name</th>");
  out.write("<th>Test Case ID</th>");
  out.write("<th>Test Name and Steps</th>");
  out.write("<th>Test Data</th>");
  out.write("<th>Expected Result</th>");
  out.write("<th>Actual Result</th>");
  out.write("</tr>");
  out.write("</body>");
  out.write("</html>");
  out.flush();
  out.close(); 
  }

上一頁12下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 99九九精品免费视频观看 | 亚洲精品午夜级久久久久 | 成年人午夜视频 | 欧美色网络 | 欧美日韩在线精品一区二区三区 | 亚洲欧美精品综合中文字幕 | 韩漫画无遮挡羞免费网站 | 日本 欧美 国产 | 黄色片在线播放 | 成年网址网站在线观看 | 私人毛片| a国产成人免费视频 | 成人高清网站 | 日本涩涩网站 | 免费看美女午夜大片 | 国产 第1页 | 欧美人体一区二区三区 | 成人窝窝午夜看片 | 永久网站www774777视频 | 亚洲日本中文字幕一本 | 免费国产午夜在线观看 | 92国产福利午夜757小视频 | 欧美视频一级 | 亚洲欧美国产精品专区久久 | 五月婷婷丁香在线视频 | 狠狠香蕉| 最近2019免费中文字幕视频三 | 久99久精品视频免费观看v | 欧美日韩视频一区二区三区 | 97精品久久天干天天蜜 | 天天射天天操天天色 | 色费女人18女人毛片免费视频 | 欧美一级免费在线观看 | 天天天天色 | 天天干干 | 亚洲视频二| 日本黄色链接 | 一级网| 国产精品亚洲一区二区在线观看 | 免费黄色在线网站 | 中国女与老外在线精品 |