我是 testNG 的新手,我有以下代码:
@BeforeMethod
public void getGroup(ITestAnnotation annotation){
System.out.println("Group Name is --" + annotation.getGroups()) ;
}
@Test(groups = { "MobilSite" })
public void test1(){
System.out.println("I am Running Mobile Site Test");
}
Run Code Online (Sandbox Code Playgroud)
我想要 before 方法中的组名,我尝试使用 ITestAnnotation但是当我运行测试时我收到以下错误
Method getGroup requires 1 parameters but 0 were supplied in the @Configuration annotation.
Run Code Online (Sandbox Code Playgroud)
你能帮助我应该从 XML 传递的参数吗?