I am opening multiple instance of browser for each data set but all the input data is getting entered only in one instance/session instead of each data set in each instance. I am using selenium and TestNG
@DataProvider(name="URLprovider", parallel=true )
private Object[][] getURLs() {
return new Object[][] {
{"Fist data"},
{"Second Data"},
{"3 data"}
};
}
@Test(dataProvider="URLprovider",threadPoolSize = 3)
public void testFun(String url){
BaseDriver baseReference = BaseDriver.getBaseDriverInstance();
System.out.println("Test class"+url +"="
+Thread.currentThread().getId());
driver = baseReference.initBrowser();
driver.get("http://stackoverflow.com/");
driver.findElement(By.xpath("//*@id='search']/div/input")).sendKeys(url);
}
So here i am opening three browser instance parallel (as we have 3 set of data in @dataprovider ) and entering value in text box. But while executing the code 3 instance is getting opened but test data value is entered only in one instance... but my expectation is to enter one data in one instance.