I'm running my TestNG tests Programatically. I'm Injecting multiple suites and executing. But when I execute the following, testng-results.xml doesn't contain all the results from each suite. I only get results of the last suite. Has anyone faced the same issue before?
TestNG tng = new TestNG();
List<XmlSuite> suites = new ArrayList<>();
for (Deployment deployment : deploymentList) {
tcList = tlsite.getTestCaseClassList();
XmlSuite suite = new XmlSuite();
suite.setName(deployment.getName());
XmlTest test = new XmlTest(suite);
test.setName("AutomationTests");
List<XmlClass> classes = new ArrayList<>();
for (Object className : tcList){
try {
classes.add(new XmlClass((String) className));
} catch (TestNGException e){
log.error("Error occurred while adding the class : " +e.toString());
}
}
test.setXmlClasses(classes) ;
suites.add(suite);
}
tng.setXmlSuites(suites);
tng.setOutputDirectory("my-out");
tng.run();
Aucun commentaire:
Enregistrer un commentaire