|
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 xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Testfr">
<parameter name="language" value="fr" />
<classes>
<class name="com.rachel.sametimeauto.appium.iOS.MeetingsTest.iOSMeetingsTVTSanityTest"/>
</classes>
</test>
<test name="Testde">
<parameter name="language" value="de"/>
<classes>
<class name="com.rachel.sametimeauto.appium.iOS.MeetingsTest.iOSMeetingsTVTSanityTest"/>
</classes>
</test>
</suite>
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! |
|