Re: [testng-users] How to configure TestNg with Eclipse Indigo

1,368 views
Skip to first unread message

DAYANANDA REDDY CHALLA

unread,
Jun 14, 2012, 8:13:02 AM6/14/12
to testng...@googlegroups.com
click on the Project-> build path->Configure build path

This will open "Properties for <Project Name>"

click on Java Build Path

go to add library

click on testng

then click "ok"

On Thu, Jun 14, 2012 at 1:32 AM, Neville Kwa <nevil...@gmail.com> wrote:
Hello,
            I have download the install TestNg and Eclipse Indigo on my Window machine.  I am having problem configuring TestNg with Eclipse Indigo.  I already install the TestNg plugin from Eclispe.  click Help > Install New Software > work with:http://beust..com/eclipse/click add/select TestNg.  After installation completed > restart the eclipse > Click dropdown run  did not see the TestNg.  Need help configure!!!

Thanks,
Neville

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/U45UBaKWBf4J.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.



--

Thanks & Regards,

DAYANANDA REDDY CHALLA


-----------------------------------------------------------------------

The sooner you fall behind, the more time you'll have to catch up.

http://nandu310.wordpress.com


Alexander Poulikakos

unread,
Jun 14, 2012, 11:01:40 AM6/14/12
to testng...@googlegroups.com

Hi

 

I have the following testng.xml:

<suite>

       <test name="test-name">

              <classes>

                     <class name="A" />

              </classes>

       </test>

</suite>

 

 

And when executed (from eclipse) I get the following exception:

[TestNG] Reporter org.testng.reporters.XMLReporter@1ded0fd failed

java.lang.NullPointerException

       at java.util.Hashtable.put(Unknown Source)

       at java.util.Properties.setProperty(Unknown Source)

       at org.testng.reporters.XMLReporter.getSuiteAttributes(XMLReporter.java:147)

       at org.testng.reporters.XMLReporter.writeSuiteToBuffer(XMLReporter.java:113)

       at org.testng.reporters.XMLReporter.writeSuite(XMLReporter.java:85)

       at org.testng.reporters.XMLReporter.generateReport(XMLReporter.java:62)

       at org.testng.TestNG.generateReports(TestNG.java:1064)

       at org.testng.TestNG.run(TestNG.java:1023)

       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)

       at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)

       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)

[TestNG] Reporter org.testng.reporters.SuiteHTMLReporter@21b6d failed

java.lang.NullPointerException

       at java.util.Hashtable.put(Unknown Source)

       at java.util.Properties.setProperty(Unknown Source)

       at org.testng.xml.XmlSuite.toXml(XmlSuite.java:452)

       at org.testng.reporters.SuiteHTMLReporter.generateXmlFile(SuiteHTMLReporter.java:91)

       at org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:76)

       at org.testng.TestNG.generateReports(TestNG.java:1064)

       at org.testng.TestNG.run(TestNG.java:1023)

       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)

       at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)

       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)

 

 

It took me some time to realize what I did wrong. I couldn’t tell much from the exception message. But I finally realized I had missed the “name” attribute in the <suite> tag. Can this behavior be changed and a better error message provided? Do I need to write some tracker for this?

 

For an example, if I forget to add the “name” attribute within the <test> tag, there’s a very good error message. Would it be possible to get a similar error message, when “name” attribute is missing from <suite> tag? This is what the exception looks like when “name” is missing from <test> tag:

 

org.testng.TestNGException:

Test <test> element must define the name attribute

       at org.testng.xml.TestNGContentHandler.xmlTest(TestNGContentHandler.java:252)

       at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:487)

       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)

       at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

       at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

       at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)

       at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)

       at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

       at javax.xml.parsers.SAXParser.parse(Unknown Source)

       at javax.xml.parsers.SAXParser.parse(Unknown Source)

       at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)

       at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)

       at org.testng.xml.Parser.parse(Parser.java:170)

       at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:304)

       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:86)

       at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)

       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)

RemoteTestNG finishing: 0 ms

 

With testng.xml

<suite name="suite-name">

       <test>

              <classes>

                     <class name="A" />

              </classes>

       </test>

</suite>

 

 

Regards,

Alex

 

 

 

 

 

Cédric Beust ♔

unread,
Jun 15, 2012, 1:40:30 AM6/15/12
to testng...@googlegroups.com
I just added a clearer error message in the beta (http://testng.org/beta ) but not Eclipse yet.

-- 
Cédric




--
You received this message because you are subscribed to the Google Groups "testng-users" group.

Alexander Poulikakos

unread,
Jun 15, 2012, 2:52:29 AM6/15/12
to testng...@googlegroups.com

Just tested it and it looks great!

 

 

 

 


Reply all
Reply to author
Forward
0 new messages