Creates HTML Metrics report based on robotframework output.xml
How it Works:
- Read output.xml file using robotframework API
- Get Suite, Test Case , Keyword , Status, Start Time, End Time and Elapsed time values using api
- Convert data to html report using Beautifulsoup
How to use in project:
-
Download robotmetrics.py from here link
Repo has some extra files (.html and .xml for testing) - I suggest to download from link
-
Copy robotmetrics.py file to project
-
Install beautifulsoup: (to create html report - one time activity)
pip install beautifulsoup4 -
Execute robotmetrics.py file
Case 1: robotmetrics.py is copied where output.xml is available
python robotmetrics.pyCase 2: Specify output.xml file path. (When .xml and .html file names are same)
python robotmetrics.py -inputpath .\Result\Case 3: Specify file name. (When .xml and .html file names are altered)
python robotmetrics.py -inputpath .\Result\ -output voutput.xml -report vreport.html -log vlog.html -
RobotFramework Metrics Report metric-.html file will be created in current folder |
-inputpathif specified
Sample report link
How to Ignore Library Keywords in Metrics Report
- In robotmetrics.py file add specific library keywords to tuple ignore_library to ignore in report
- In Metric report, keywords with type value 'for' and 'foritem' are ignored
- Following library keywords are ignored in Metrics Report
ignore_library = [ 'BuiltIn', 'SeleniumLibrary', 'String', 'Collections', 'DateTime', ]
Credits:
- Robotframework link
- Stackoverflow link
- Google charts link
- DataTable link
- BeautifulSoup link
- Jquery | JavaScript link
- Bootstrap link
- Icons8 link
- FontAwesome link