Robot Framework Metrics Dashboard

介紹

下面介紹一款Robot Framework(以下簡稱RF)測試指標(biāo)的可視化Dashboard工具robotmetrics
效果如下圖所示:

robot metrics

安裝使用

工作原理

  1. 使用RF的API讀取RF的輸出文件output.xml
  2. 使用API獲取Suite, Test Case, Keyword, Status, Start Time, End Time以及Elapsed time值
  3. 使用BeautifulSoup庫將數(shù)據(jù)生成html 報(bào)告

在工程中使用

  1. github倉庫中下載robotmetrics.py文件
  2. robotmetrics.py文件拷貝到工程項(xiàng)目中
  3. 安裝beautifulsoup
    pip install beautifulsoup4
  4. 執(zhí)行robotmetrics.py文件
案例1:`robotmetrics.py`文件與`output.xml`文件在同目錄
python robotmetrics.py

案例2:指定`output.xml`文件路徑
python robotmetrics.py -inputpath .\Result\

案例3:指定文件名稱

python robotmetrics.py -inputpath .\Result\ -output voutput.xml -report vreport.html -log vlog.html 
  1. Robot Framework指標(biāo)報(bào)告metric-timestamp.html會生成在指定的目錄中
  2. 郵件會將指標(biāo)文件metric-timestamp.html發(fā)送到配置的收件人郵箱

配置

在指標(biāo)中忽略一些不需要的庫關(guān)鍵字

  • robotmetrics.py文件中將不需要的關(guān)鍵字庫添加到元組對象ignore_library
  • 在指標(biāo)報(bào)告中,關(guān)鍵字FOR, FORITEM會被忽略
  • 以下是被忽略關(guān)鍵字的庫
ignore_library = [
 'BuiltIn',
 'SeleniumLibrary',
 'String',
 'Collections',
 'DateTime',
] 

你可以添加新的忽略庫,如RequestsLibrary, AppiumLibrary

總結(jié)

適當(dāng)?shù)拿阑瘻y試報(bào)告信息,可以更好的表達(dá)測試信息。
如有問題,可以通過以下郵件聯(lián)系。

wywincl522@gmail.com

大家也可以加入RobotFramework社區(qū)來交流學(xué)習(xí)。


Robot Framework社區(qū)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容