报错:Cannot inject @Test annotated Method [testA] with [class java.lang.String].

运行代码报错:Cannot inject @Test annotated Method [testA] with [class java.lang.String].
For more information on native dependency injection please refer to http://testng.org/doc/documentation-main.html#native-dependency-injection;

找了很多方法都没找到原因

百度后发现文章:https://sqa.stackexchange.com/questions/25436/what-does-this-mean-cannot-inject-test-annotated-method-f-with-interface   里面提示@Test 方法不能有参数,然后看了下自己的方法 果然是这样,去掉参数 问题解决;

猜你喜欢

转载自blog.csdn.net/qq_33719152/article/details/86073135
今日推荐