标题: TestNG 参数传递问题求助! [打印本页] 作者: mashenka123 时间: 2016-5-19 00:51 标题: TestNG 参数传递问题求助! error: FAILED CONFIGURATION: @BeforeClass startDriver
org.testng.TestNGException:
Parameter 'language' is required by @Configuration on method startDriver but has not been marked @Optional or defined
My code:
@BeforeClass(alwaysRun = true)
@Parameters("language")
public void startDriver(String language) throws Exception{
driver=driverFactory.getIOSDriver(language,service);
System.out.println("start driver");
}
@Test
public void login() {
...
}
I read previous posts about this error and did:
1. Use my testng.xml as template in project properties
2. Right click testng.xml->run as testng suite
3. Select my .java test file and right click->run as testng test
But still get this error, could anyone provide kindly help? Thank you!