I have the following test cases:
- Login - Logout
- Login - Search - Logout
- Login - Search - Click on result - Logout
All these 3 testcases are considered to be independent and are within a single testNg class.
How do I validate the First test case (i.e. how to check if login is successful) ?
I have tried using assert
, but when assert
fails the remaining test cases (which are actually independent on the first one) will all be skipped.
How do I make sure that I validate all the test cases and irrespective of whether they pass or fail i should continue to execute all the test cases within that testNG class?
It looks like you are looking for ErrorCollector. Or you can use custom SoftAssert. This is my ErrorCollector realization for JUnit: