Running testng programatically giving error as : Two suites cannot have the same name

526 views
Skip to first unread message

rajesh

unread,
Oct 11, 2013, 11:37:58 AM10/11/13
to testng...@googlegroups.com, tha...@ca.com
Hi,

I'm trying to run testng programatically but it's giving error as "Two suites cannot have the same name" even my test suite files has only one file.


my code to run testng programatically.

TestNG testng = new TestNG();
testng.setXmlSuites((List <XmlSuite>)(new Parser("./Suite.xml").parse()));
testng.setListenerClasses(listenrs);
testng.run();


and my test suite file:

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Test Suite" verbose="2" > 

<suite-files>
<suite-file path="./src/resources/TicketsWorkspace.xml" /> 
</suite-files>
</suite>

I need to run actually multiple suites but it's not running even with one. If i change the testng.run() to testng.runSuitesLocally(); its running fine. 

any help?

Jorge Muñoz

unread,
Oct 21, 2013, 10:22:04 AM10/21/13
to testng...@googlegroups.com, tha...@ca.com
I had the same problem and i resolved. I executed from Eclipse with plugin TestNG (right button over testng.xml + run as + testNG Suite). The problem was that i have a argument "testng.xml" in the configuration of execution and seems that TestNG executed this testng.xml 2 times. I remove this param, try and this time runned correctly.

Perhaps is the same error
Reply all
Reply to author
Forward
0 new messages