I have a scenario where i need to run my selenium test in parallel using the same data provider. From what i have read it is possible but could not get it to work.I have a hub and a node running on one machine and have another node running on another machine.
My DataProvider
// Data provider for Storage Rule Suite
@DataProvider(name = "StorageRuleDataProvider", parallel =true)
public static Object[][] getStorageData(Method m) {
return TestUtil.getData(m.getName(), TestBase.storageSuite);
}
My Test
@Test(groups = { "CreateNewStorageRule" }, dependsOnGroups = { "StoragePage" }, dataProviderClass = TestDataProvider.class, dataProvider = "StorageRuleDataProvider", threadPoolSize = 20)
public void createNewStorageRuleTest(Hashtable<String, String> data){}
XML
<suite name="Storage Rule Suite" parallel="tests" data-provider-thread-count="20" >
When i run the test in the xml file, i have two set of browser opening on each node but when it attempts to do a login, sometimes it enters the credentials twice in one browser and nothing on the other and sometimes nothing gets entered on one browser.