我想用transformer类设置组名,但类内testname为null。我怎样才能得到你能帮我吗?
这是我的xml文件
<test name="Firefox">
<parameter name="browser" value="firefox"/>
<groups>
<run>
<include name="zalenium"/>
</run>
</groups>
<classes>
<class
name="demo.RunnerTest"/>
</classes>
</test>
还有我的变形金刚班
public class MyTransformer implements IAnnotationTransformer {
@Override
public void transform(ITestAnnotation annotation, Class testClass,
Constructor testConstructor, Method testMethod) {
System.out.println(annotation.getTestName());
if (annotation.getTestName() == "Firefox") {
String grps[] = new String[]{"regression"};
annotation.setGroups(grps);
System.out.println("groups..." + Arrays.toString(annotation.getGroups()));
//prints groups...[regression]
}
}
}
现在testname在ss中
暂无答案!
目前还没有任何答案,快来回答吧!