paypal/SeLion

Excel DataProvider - Enhancement request to return value based on the field names

Opened this issue · 0 comments

SeLion Version

All

Steps to Reproduce

Below method is reading the values from Excel and mapping it to the POJO class based on the order in which the fields are declared in the class. We are expecting small enhancement here to map the values based on the field names in the POJO class. Here the field names will match with column names. So if we map the value by matching the field and column name, then we don’t need to worry about the order of field declaration. So all the test class can use the same Data Provider class (POJO class) and it will be easy for maintenance also.

DataResource resource =
new FileSystemResource("src/test/resources/testdata/MyDataFile.xls",
SimpleData.class);
SeLionDataProvider dataProvider =
DataProviderFactory.getDataProvider(resource);
return dataProvider.getAllData();