0

I am creating data in excel for DataDriven framework.I am getting problem how to use that data if there is drop down.

example- for Travelling site there is drop-down list of cites in arrival list

If I am keeping all cites name in excel how to use it in framework.

Ravi Anand
  • 47
  • 1
  • 3
  • 12

1 Answers1

0

You can use TestNG unit testing framework here since you are using Java. especially @dataprovider example. For code of fetching data from excel, you can use JExcel api..

Below code will run same test case one by one for each city in excel file and select from dropdown. See below code for more reference :

@Test(dataProvider = "DP1")
public void selectCityFromDropDown(String city) throws Exception {
    // Selenium webdriver code for selecting city from  drop down.
}

@DataProvider(name = "DP1")
public Object[][] createData1() throws Exception {
    // code to open excel file, fetch data from excel file and generate two dimentional array of String/Object class so that it can be returned back to test case
}
Pratik G
  • 99
  • 2