TestNG vs Junit
Test NG
|
JUNIT
|
Easy to Configure
|
Complex
|
Parameterization is Simple
|
Complex
|
Reporting is simple and Crisp
|
Not very presentable
|
Assersion needs Listeners
|
Assersion needs a) try-catch
b)ErrorCollector
Example :
Public Class Class_name
{
@Rule
public ErrorCollector errCollector =new ErrorCollector();
@test
p v T1test()
{
try
{
Assert.assertEquals(10,20);
}Catch (Throwable t)
{
s . o .println(“error”);
errcollector.addError(t);
}
}
|
No comments:
Post a Comment