是否可以在 TestNG 中为相同的测试方法传递参数和数据提供者

Is it possible to pass parameter and dataprovider for same test method in TestNG

/* testdataprovider will return the test2 and test3 parameter value */
@Parameters("test1")
@Test(dataProvider = "testdataprovider")
public void testMethod(String test1, String test2, String test3){}

目前(最新的TestNG版本为6.9.9),无法达到您的预期。 原因是 TestNG 无法理解哪个参数来自数据提供者,哪个参数来自 @Parameters.

我预计可以在 @DataProvider 方法上添加 @Parameters,但是 it looks like it is not possible for the moment.