Skip to content

Instantly share code, notes, and snippets.

@adiralashiva8
Created January 28, 2019 15:53
Show Gist options
  • Save adiralashiva8/78fec0912499718d43b565f875d3081c to your computer and use it in GitHub Desktop.
Save adiralashiva8/78fec0912499718d43b565f875d3081c to your computer and use it in GitHub Desktop.
Robotframework: Get test case statistics by parsing output.xml using robot.result package (api)
from robot.api import ExecutionResult, ResultVisitor
result = ExecutionResult("output.xml")
stats = result.statistics
total_tests= stats.total.all.total
passed_tests= stats.total.all.passed
failed_tests= stats.total.all.failed
print total_tests
print passed_tests
print failed_tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment