I am learning to use Selenium with Eclipse for the automation of tests. When I try to run annotations, I get the error:
the annotation "X" is disallowed for this location.
As I am starting with the theme, I am leaving something important in the pipeline.
package TestNG;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
import org.testng.annotations.Test;
@BeforeTest
public void login() {
System.out.println("BT");
}
@AfterTest
public void logout{
System.out.println("AT");
}
public class TestNGClass {
@Test
public void testContact(){
System.out.println("Test1");
}
}
Could someone help me with the error? Thank you.