I am using testNG and Appium to run mobile automation.Following are my codes:
package my.app.package;
public class TestDataProvider {
@DataProvider(parallel=false)
public static Object[][] GenericDataProviderWithNoCustomCapabilities() {
return new Object[][] {
{"", "Nexus_5_API_21_x86", "19", "C:\\Users\\me\\Desktop\\app.apk", "http://127.0.0.1:4723/wd/hub", ScreenOrientation.PORTRAIT},
{"", "Nexus_5_API_21_x86", "20", "C:\\Users\\me\\Desktop\\app.apk", "http://127.0.0.1:4723/wd/hub", ScreenOrientation.LANDSCAPE}
};
}
}
In the test suite class:
public class SanityTestAndroid {
private ScreenOrientation orientation;
@Factory(dataProviderClass = my.app.package.TestDataProvider.class, dataProvider="GenericDataProviderWithNoCustomCapabilities")
public SanityTestAndroid(String version, String avd, String platformVersion, String appPath, String targetPath, ScreenOrientation orientation) throws Exception {
AndroidDriverFactory.create(version, avd, platformVersion, appPath, targetPath);
this.orientation = orientation;
}
@Test()
public void testLoginInLandscape() throws Exception {
if (orientation == ScreenOrientation.LANDSCAPE) {
...}
...}
And testNG.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="android automation" parallel="false">
<test name="com.tribehr.qa.tests">
<classes>
<class name="my.app.package.test.SanityTestAndroid "/>
</classes>
</test>
</suite>
I have set all testNG parallel to false (as far as I know), but when running the test I still see it being run parallelly. I am not sure why, and what can I do to make it run twice in a queue (as two dataset are given).