0
初學者TestNG的隨時添加參數錯誤TestNG的參數失效
請各位高手幫忙看一下
謝謝!!
java代碼:
public class NewTest{
@Parameters({"names"})
@Test
public void test(String name){
System.out.println(name);
}
TestNGxml:
異常信息:
org.testng.TestNGException:
Parameter 'names' is required by @Test on method Test
but has not been marked @Optional or defined
in D:\Documents and Settings\huohui\workspace\lianxi\src\test.xml
正確,屬性是「value」而不是「values」。 –