testNG UnitTest

Welcome To Tripathi Unit Test Page by Using TetsNG Unit Test Step by Using TetsNG:
Step-1 Install Any Java IDE into your system
Step-2 Start STS and goto Help Menu
Step-3 Install new Software
Step-4 click  Add
Step-5 name-->testNg
Step-6 location-->http://beust.com/eclipse
Step-7 Create testNG UnitTest class
      eg
@ContextConfiguration(locations={"file:src/main/webapp/WEB-INF/spring/root-context.xml"})
@Component
public class UnitTest extends AbstractTestNGSpringContextTests {
@BeforeTest
    public void beforeTest() throws Exception {
       
    }
@Test(priority=1)   Method1
@Test(priority=2)   Method2
@Test(priority=3)   Method3
@Test(priority=4)   Method4

}
Step-8 Right click and Run as testNG
PASSED: method1
PASSED: method2
PASSED: method3
PASSED: method4

===============================================
    Default test
    Tests run: 4, Failures: 0, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 4, Failures: 0, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@bf2d5e: 6 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@8a0d5d: 28 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@1e4457d: 68 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@10b4b2f: 27 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 0 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@16cd7d5: 3 ms

1 comment:

  1. we are very greatful to you such a great explanation.one of the recommanded blog.very useful content best regards from sbr learn more from

    sbr training

    ReplyDelete