如何在TestNG中注入自定义测试方法参数

时间:2015-03-02 12:46:41

标签: testing testng

我需要一种方法将自定义参数注入TestNG的测试方法。 该参数是我自己的对象,在运行时从测试方法注释动态构建。 TestNG不知道自定义参数,它是我自己的类型,例如:

@com.mypackage.MyAnnotation("someValue)"
@org.testng.Test
public void test(MyCustomObject val) {
    ...
}

我最需要使用一些TestNG的监听器,但我找不到哪一个。

我不想使用@DataProvider 注释。

0 个答案:

没有答案