Question

I am running the Selenium Test cases in parallel using TestNG in different browsers. (usage of: Selenium-Grid) I want to execute the same test case in different browser with different(variation of same) data. For eg. a same data can not be used in case of 'registration' over different browsers. As once the member is registered on a website can not register again in the same.

Req: Registration test case in 3 browsers IE,FF,Chrome in parallel. I am using

@DataProvder(name="RegData",parallel=true) 
public Object[][] getRegData() { 
Object[][] data = {{"Max","Male","Italy"},{"James","Male","France"},{"Alex","Male","Spain"}}; 
return data; 
}

This data is utilized as Test Data. But what happens is each test case is executed 3 times. Each Test-case with each 'data' instance. so 3 Test Cases x 3 'data' entries = 9 executions. Each data instance should be utilized only once. Total executions should be only 3

No correct solution

OTHER TIPS

The intention of the dp is to do exactly that. Run a set of steps with different data. You are running the testcase in 3 browsers and with 3 data. So each browwser would run with each of the 3 data. That is expected.

If you want that one data should go to one browser then the browser too should be passed as part of the dataprovider. So data1 with browser1, data2 with browser2 and data3 with browser 3 - this would ensure each browser runs with one data.

In your flow, it seems you are testing registration thrice. The design seems to be incorrect from whatever you mention.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top