This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.api import ExecutionResult, ResultVisitor | |
total_suite = 0 | |
passed_suite = 0 | |
failed_suite = 0 | |
class SuiteResults(ResultVisitor): | |
def start_suite(self,suite): | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.api import ExecutionResult, ResultVisitor | |
total_keywords = 0 | |
passed_keywords = 0 | |
failed_keywords = 0 | |
class KeywordResults(ResultVisitor): | |
def start_keyword(self,kw): | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.api import ExecutionResult, ResultVisitor | |
class SuiteResults(ResultVisitor): | |
def start_suite(self, suite): | |
suite_test_list = suite.tests | |
if not suite_test_list: | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.api import ExecutionResult,ResultVisitor | |
class TestMetrics(ResultVisitor): | |
def visit_test(self,test): | |
print "Test Name: " + str(test.name) | |
print "Test Status: " + str(test.status) | |
print "Test Starttime: " + str(test.starttime) | |
print "Test Endtime: " + " " + str(test.endtime) | |
print "Test Elapsedtime (Sec): " + " " + str(test.elapsedtime/float(1000)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.api import ExecutionResult,ResultVisitor | |
class KeywordMetrics(ResultVisitor): | |
def visit_keyword(self,kw): | |
print "Keyword Name: " + str(kw.name) | |
print "Keyword Status: " + str(kw.status) | |
print "Keyword Starttime: " + str(kw.starttime) | |
print "Keyword Endtime: " + " " + str(kw.endtime) | |
print "Keyword Elapsedtime (Sec): " + " " + str(kw.elapsedtime/float(1000)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.w3c.dom.*; | |
import org.xml.sax.SAXException; | |
import javax.xml.parsers.*; | |
import java.io.*; | |
public class Metrics{ | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.w3c.dom.* ; | |
import org.xml.sax.SAXException; | |
import javax.xml.parsers.* ; | |
import java.io.* ; | |
public class TestngMetrics { | |
public static void main(String[] args) { | |
String path = System.getProperty("user.dir") + "/testng-result.xml"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE doctype html> | |
<html lang="en"> | |
<head> | |
<link href="https://img.icons8.com/flat_round/64/000000/bar-chart.png" rel="shortcut icon" type="image/x-icon"/> | |
<title> TestNG Metrics Report</title> | |
<meta charset="utf-8"/> | |
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"/> | |
<meta content="width=device-width, initial-scale=1" name="viewport"/> | |
<link href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" rel="stylesheet"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.w3c.dom.* ; | |
import org.xml.sax.SAXException; | |
import javax.xml.parsers.* ; | |
import java.io.* ; | |
public class TestNGMetricsReport { | |
public static void main(String[] args) { | |
String path = System.getProperty("user.dir") + "/result6.xml"; |
OlderNewer