How to run two tests in selenium with diff data using data provider | Selenium Forum
panienator Posted on 10/07/2020

Here is the steps,

in same class file below 2 tests are present

1. @Test

//This will have login details

public void login(){

code here to login


2. @Test

//This will have booking details

public void createbooking(){




now i have two data providers one for login and another for create booking with two sets of data like,


username and password( two sets) - Object[][] ar = new Object[2][2];  - for login Test


bookingname, booking type and bookingcontainer( two sets) - Object[][] ar = new Object[2][3]; - for create booking Test


Now i want to run for two sets of data one after another in same class - How to do this


Please help



Ashish Replied on 11/07/2020

Have you seen data driven or hybrid framework?

Thats what i have told there

panienator Replied on 12/07/2020

Thanks will look into it


Also, one suggestion


Can you please add search option in this query resolution page so that by using search we can search for other people questions who have posted. This way it will help if our question and already posted question by someone is there we can just use that without having to ask question again

Ashish Replied on 15/07/2020

Sure we will put the search option.

I saw your issue closely now. Its not possible to do the way you are expecting using data provider

panienator Replied on 15/07/2020

So, please help how can we achieve the above scenario.


Sure we will put the search option. - Thanks

Ashish Replied on 30/07/2020

Please refer to Hybrid Framework or Data-Driven Framework. We have covered in detail how you can run different test cases with different sets of data.

panienator 3 days ago

Yeah Sure Will Check that



Related Posts