Method Name |
Parameter |
Return Type |
Usage |
Example |
getMaxRows |
|
int |
To get max rows |
ExcelConnector.getMaxRows(); |
setMaxRows |
maxRowCount:int |
void |
To set max rows |
ExcelConnector.setMaxRows(maxRowCount); |
setColumnNames |
selectedColumns:String[] |
void |
To set column name |
ExcelConnector.setColumnNames(selectedColumns); |
getFileName |
|
String |
To get file name |
ExcelConnector.getFileName(); |
getSheetName |
|
String |
To get sheet name |
ExcelConnector.getSheetName(); |
setSheetName |
sheetname:String |
void |
To set sheetname |
ExcelConnector.setSheetName(sheetname) |
openSheet |
excelFile:File, sheetName:String |
void |
Open a sheet based on excelFile and sheet name |
ExcelDriver.openSheet(excel file name,sheet name); |
openSheet |
excelFile:File, sheetNo:int |
void |
Open a sheet based on excelFile and sheet number |
ExcelDriver.openSheet(excel file name,sheet number); |
goToSheet |
sheetNo:int |
void |
To proceed to a sheet based on sheet number |
ExcelDriver.goToSheet(SheetNo); |
goToSheet |
sheetName:String |
void |
To proceed to a sheet based on sheet name |
ExcelDriver.goToSheet(SheetName); |
getCurrentWorkbook |
|
Workbook |
To return the current workbook |
ExcelDriver.getCurrentWorkbook(); |
getCurrentSheet |
|
Sheet |
To return the current sheet in the workbook |
ExcelDriver.getCurrentSheet(); |
getHeaderMap |
|
Map<String,Integer> |
To return the current sheet header in a hashmap |
ExcelDriver.getHeaderMap(); |
getColumnHeaderNo |
columnName :String |
int |
To obtain the column header number |
ExcelDriver.getColumnHeaderNo(columnName); |
getCellValueAt |
row:int,column:int |
String |
To obtain a particular cell value based on row and column number |
ExcelDriver.getCellValueAt(row number,column number); |
getRowMap |
rowNo:int |
Map<String,String> |
To obtain the values of all columns in a row with header row value(assuming that the first row is header row) based
row number as parameter |
ExcelDriver.getRowMap(rowNo) |
getRowMap |
rowNo:int,hasHeader :boolean |
Map |
To get row map |
ExcelDriver.getRowMap(rowNo,hasHeader); |
getRowMap |
columnNo:int,data :String |
Map<String,String> |
To obtain the values of all columns in a row with header row value(assuming that the first row is header row) based on
column number and required matching data as parameter |
ExcelDriver.getRowMap(columnNo,data); |
getRowMap |
columeName:String,data :String |
Map<String,String> |
To obtain the values of all columns in a row with header row value(if the first row is header row) based
on column name and matching data as parameter |
ExcelDriver.getRowMap(columeName,data); |
getRowNoByColumnData |
columeNo:int,data :String |
int |
To obtain row number by column data |
ExcelDriver.getRowNoByColumnData(columeNo,data); |
getRowNoByColumnName |
columnHeader:String,value :String |
int |
To obtain row number by column name |
ExcelDriver.getRowNoByColumnName(columnHeader,value |
switchToFile |
filePath:String |
void |
To switch to another excel file |
ExcelDriver.switchToFile(filepath); |
createWorkbook |
excelFile:File |
Workbook |
To Create a workbook |
ExcelDriver.createWorkbook(excelFile); |
isXlsFileType |
excelFile:File |
boolean |
Defining workbook |
ExcelDriver.isXlsFileType(excelFile) |
setHeaderMap |
currentSheet:Sheet |
void |
To obtain the current sheet |
ExcelDriver.setHeaderMap(currentSheet) |
getRowCount |
|
int |
To get row count |
ExcelDriver.getRowCount(); |
GetData |
key : String, exclConn : ExcelConnector |
TestDataObject |
To get data |
ExcelConnector exclConn = new ExcelConnector(filename, sheetname);
TestDataFactory test = new TestDataFactory();
TestDataObject obj = test.GetData(key, exclConn); |
setSheetData |
excelData : TestDataObject, excelDriver : ExcelDriver,maxRowCount:Integer |
TestDataObject |
To set sheet data |
|
getMapData |
|
Map<String, String> |
To get map data |
TestDataObject.getMapData(); |
setMapData |
mapData:Map<String, String> |
void |
To set map data |
|
getTableData |
|
LinkedHashMap <String, Map<String, String>> |
To fetch excel sheet data |
ExcelConnector con = new ExcelConnector(filename, sheetname);
TestDataFactory test = new TestDataFactory();
TestDataObject obj = test.GetData(key, con);
LinkedHashMap < String, Map < String, String >>
getAllData = obj.getTableData(); |
setTableData |
tableData :LinkedHashMap <String, Map<String, String>> |
void |
To set excel sheet data |
|