what is the difference between JUnit 3, JUnit 4, TestNG in selenium how selenium is implemented differently in these three testing frameworks?
Can any one explain clearly..
Thanks in Advance..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
TestNG handles dependency between test cases. If one test case failure causes the failure of a group of test cases it skips that group and executes the rest of the test suite. The group that has dependency on the failed test cases is reported as skipped NOT failed.
In Junit, one test case failure can cause a bunch of test cases to fail in the test suite. There is no option of skipping the set of dependent test cases. The dependent test cases are also reported as failures. For example, suppose there is a test case to test login and the next 10 test cases need to perform a transaction after login. If the login test case fails the other 10 test cases will also fail.
In TestNG groups can be defined. Groups are specific subsets of the test suite. We can choose to run only a specific subset of the test suite say database related test cases instead of running the entire test suite. This can be done as below:
In the test case we define two groups DBTestcase and deprecated as below:
In Junit for a long time it was not possible to run a specific subset of the test cases. We can either run the entire suite or run each test case individually. Junit 4.8 introduced a new feature called “Categories” to overcome this limitation. However groups are much easier to configure in TestNG.
Thus if you have junit 3.x series you cannot define groups. However junit 4.8 and above supports it.