What is the difference between TESTNG and JUNIT? List out Annotations?

Answer Posted / chandra shekar u

JUNIT performs on serial Testing. Where as TESTNG can do both parallel and serial testing. This is the main difference. CUCUMBER can work only with JUNIT.

JUNIT annotations are:
@Test, @Before, @After, @Ignore, @BeforeClass, @AfterClass, @Rule, @Runwith(Suite.class), @SuiteClasses({}), @Parameters and @RumWith(Parameterized.class).

TESTNG Annotations are:
@Test, @Parameters, @BeforeMethod, @AfterMethod, @BeforeTest, @AfterTest, @BeforeClass, @AfterClass, @BeforeGroups, @AfterGroups, @BeforeSuite, @AfterSuite and @DataProvider

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does one execute java scripts function in selenium?

511


To enter values onto text boxes what is the command that can be used?

563


What is the syntax of finding elements by id using css selector?

502


How many types of waits in selenium?

490


How to check if an element is visible on the web page?

513






What is Dynamic xpath in selenium ?

549


Which is the package which is to be imported while working with webdriver?

591


What are the features of selenium ide ?

527


What is the use of driver.get("url") and driver.navigate().to("url") command? Is there any difference between the two?

538


what is the use of x-path?

540


Tell us how many exceptions do you know in selenium webdriver?

479


How can we type text in a textbox element using selenium?

528


How does testng allow you to state dependencies? Explain it with an example.

3032


What is a hub in selenium grid?

565


What kind of keyboard operations can be performed in selenium?

474