I am trying to use @Parameter to pass language value, to let my test re-run with a new driver initialized with capabilities.setCapability(“language”,language);
So I can have the suite run on language, then rerun on language2 automatically.
My xml: <?xml version="1.0" encoding="UTF-8"?>
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:
- Use my testng.xml as template in project properties
- Right click testng.xml->run as testng suite
- Select my .java test file and right click->run as testng test
But still get this error, could anyone provide kindly help? Thank you!