@ Override public Object [ ] [ ] getDataByKeys ( String [ ] keys ) { logger . entering ( Arrays . toString ( keys ) ) ; Object [ ] [ ] obj = new Object [ keys . length ] [ 1 ] ; for ( int i = 0 ; i < keys . length ; i ++ ) { obj [ i ] [ 0 ] = getSingleExcelRow ( getObject ( ) , keys [ i ] , true ) ; } logger . exiting ( ( Object [ ] ) obj ) ; return obj ; }
This function will use the input string representing the keys to collect and return the correct excel sheet data rows as two dimensional object to be used as TestNG DataProvider .