TestRunner throws TestNG exception indicating duplicate suite names when there are no duplicates present

226 views
Skip to first unread message

Hemant Sushant

unread,
Oct 17, 2013, 2:10:19 AM10/17/13
to testn...@googlegroups.com
When invoking the test runner programmatically using the one master xml and multiple suite files, it is throwing a TestNG exception stating 'two suites cannot have the same name'.
But there are no duplicate file names in the linked suite file.

Attached the project with main-suite.xml as the master xml.
BugReport.zip

Hemant Sushant

unread,
Oct 21, 2013, 1:55:18 AM10/21/13
to testn...@googlegroups.com
The suite is working fine when I right click the main_suite.xml and run as a TestNG test suite. But when the xml suite is run using the run method in TestNG, it is throwing the below error.
 
Exception in thread "main" org.testng.TestNGException:
Two suites cannot have the same name: Suite_Add_New
 at org.testng.TestNG.checkSuiteNamesInternal(TestNG.java:1019)
 at org.testng.TestNG.checkSuiteNamesInternal(TestNG.java:1022)
 at org.testng.TestNG.checkSuiteNames(TestNG.java:1012)
 at org.testng.TestNG.sanityCheck(TestNG.java:985)
 at org.testng.TestNG.run(TestNG.java:1037)
 
I have confirmed that there are no duplicate suite names in the child files though TestNG is throwing an exception at checkSuiteNamesInternal(List<XmlSuite> suites, Set<String> names) method. Any help is appreciated.
 
Thanks
Hemant
Reply all
Reply to author
Forward
0 new messages