TestNG Tutorial

TestNG (Next Generation) is a testing framework which inspired by JUnit and NUnit, but introducing many new innovative functionality like dependency testing, grouping concept to make testing more powerful and easier to do. It is designed to cover all categories of tests: unit, functional, end-to-end, integration, etc…
Happy learning TestNG :)
TestNg Tutorials
- Tutorial 1 – Basic usage
Introduces basic annotation supported in TestNG. - Tutorial 2 – Expected Exception Test
Test the exception throw by the method. - Tutorial 3 – Ignore Test
Ignore certain method for unit test. - Tutorial 4 – Time Test
Make sure the testing method will return after certain time. - Tutorial 5 – Suite Test
Bundle a few unit test cases and run it together. - Tutorial 6 – Parameterized Test – 1
Passing parameter (primitive value and object) for unit test. - Tutorial 6 – Parameterized Test – 2
Just another TestNG parameter testing example. - Tutorial 7 – Dependency Test
Perform the dependency testing in unit test.
JUnit Vs TestNG
- JUnit 4 Vs TestNG – Comparison
Detail feature comparison between JUnit 4 and TestNG.

Hi mkyong, how to mock database with testng .. Am using struts2 framework .. Really got stuck .. Please do guide me ..
can u send the webdriver testcase for validation of registration page.(contains dropdown,editbox,radiobuttons,listbox,buttons.)
Thank you for this tutorial – quick and effective. This is exactly what I was looking for.
Hi yong,
what is the best api for mock testing with testNG?
Thanks,
Manoj
Thank you. This is very helpful!
I was using TestNG for running my Silk4J tests. I was able to run the individual tests, but while running as a suit i am facing some issues.
While running as a suit, the methods in the @BeforeMethod and @AfterMethod sections are not working… What might be the reason for this…
Can testNG provide the output of on an ANDROID EMulator connected to Eclipse?
Yes