Skip to content

TamilarasanR/robotframework-metrics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robot Framework Metrics Report

Creates HTML Metrics report based on robotframework output.xml.

HitCount PyPI version Downloads PRs Welcome Maintenance Open Source Love png1


  • Sample Report link
  • What's new in _v3.1.1 link
  • Source Code used to parse output.xml in metrics report link

How it Works:

  1. Read output.xml file using robotframework API
  2. Get Suite, Test Case , Keyword , Status and Elapsed time values
  3. Convert data to html report using Beautifulsoup

How to use in project:

  1. Install robotmetrics

    Case 1: Using pip

    pip install robotframework-metrics
    

    Case 2: Using setup.py (clone project and run command within root)

    python setup.py install
    
  2. Execute robotmetrics command to generate report

    Case 1: No change in output.xml, log.html file name's and user is in same folder

    robotmetrics
    

    Case 2: Change in output.xml, log.html file name's And .xml and .html files are under 'Result' folder

    robotmetrics --inputpath ./Result/ --output "output1.xml" --log "log1.html"
    

    For more info on command line options use:

    robotmetrics --help
    
  3. RobotFramework Metrics Report metric-timestamp.html file will be created in current folder | -inputpath if specified

  4. Email will be sent to mentioned recepient with metric-timestamp.html file


Customize Report

Specify Logo in Robotframework metrics:

  • Custom Logo : Customize your logo by using --logo command line option

    --logo "https://encrypted-tbn0.gstatic.com/images"
    

How to Specifiy EMAIL recepients

  • Default robotmetrics uses gmail server. From command line users have to specific FROM, PWD, TO and CC

    robotmetrics --email true --from "user1@gmail.com" --pwd "***********" --to "user2@gmail.com,user3@yahoo.com"
     --cc "user4@yahoo.com,user5@gmail.com" 
    
    
  • From 3.1.2: -E or --email in command line is considered as true

    (3.1.2 is in developement - can get by cloning master)

    robotmetrics --email --from "user1@gmail.com" --pwd "***********" --to "user2@gmail.com,user3@yahoo.com"
     --cc "user4@yahoo.com,user5@gmail.com"
    
    

How to Disable EMAIL

  • By default email will be sent to mentioned recipients when robotmetrics command is executed. Using --email false can disable email

    robotmetrics --email false
    

How to Ignore Library Keywords in Metrics Report

  • Use command line options to ignore library keywords
    --ignore "Collections,Selenium2Library"
    
  • 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',
    ] 
    

Generate robotframework-metrics after execution

Execute robotmetrics command after suite or test execution as follows:

  • Create .bat (or) .sh file with following snippet

    robot test.robot &&
    robotmetrics [:options]
    

    && is used to execute multiple command's in .bat file

  • Modify robotmetrics command as required and execute .bat file

  • Robotframework metrics will be created after execution


*Performance Improvement (Beta) *

  • Do you feel robotmetrics command taking more time to capture metrics? Robotframework-metrics have ability to process metrics in parallel using gevent (which helps in saving time)
  • Step 1: Install gevent
  • Step 2: Execute robotmetrics command

Thanks for using robotframework-metrics!

  • What is your opinion of this report?
  • What’s the feature I should add?

If you have any questions / suggestions / comments on the report, please feel free to reach me at


Credits:

  1. Robotframework link
  2. Stackoverflow link
  3. Google charts link
  4. DataTable link
  5. BeautifulSoup link
  6. Jquery | JavaScript link
  7. Bootstrap link
  8. Icons8 link
  9. FontAwesome link

Note: Robotframework-metrics uses above open source libraries for generating report.


Special Thanks To:

Contributors:

  1. Pekka Klarck [Author of robotframework]

    • Contributed source to get 'Test Case' name from keyword
    • Suggested to use robotframework api to parse output.xml content
  2. Ruud Prijs

    • Contributed source to use command line options for report
  3. Jesse Zacharias

    • Made robotmetrics installable (pip)
    • Contributed source to improve performance
  4. Bassam Khouri

    • Contributed source to use ArgParser
    • Contributed source to provide a human readable error if output.xml does not exist

Feedback:

  1. Mantri Sri
  2. Prasad Ozarkar
  3. Robotframework community users

About

Generation of metrics report based on robotframework output.xml

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 93.9%
  • Python 6.1%