@Test: The @Test attribute is the most important and commonly used annotation of TestNG. It is used to mark a class or a method as part of the test.
Now, let’s see some important attributes of @Test annotations
description
It is a string which is attached to the @Test annotation that describes the information about the test.
Example:
@Test(description="Sample Description")
public void description(){
System.out.println("Description of the method");
}
@Test(description="This is testcase2")
public void testcase2()
{
System.out.println("Execution of methods");
}
In the above code, we have added the description attribute in every test. The "description" attribute provides information about the test.
groups
timeOut
priority
dependsOnMethods
enabled