コード例 #1
0
  public static String getlatitudevalue(int i, int start) throws Exception {

    String latitude = null;
    try {
      latitude = ExcelUtils.getCellData(i, start);

    } catch (Exception e) {
      Log.error("Class ExcelUtil | Method getRowContains | Exception desc : " + e.getMessage());
      throw (e);
    }

    return latitude;
  }
コード例 #2
0
 public static int[] getColNameIndex(String colName, int totalCol) throws Exception {
   int[] colIndex = null;
   String temp = null, col = null;
   int j = 0;
   for (int i = ExcelUtils.getFirstRowNum(); i < totalCol; i++) {
     temp = ExcelUtils.getCellData(1, i).replace(" ", "");
     col = colName.replace(" ", "");
     if (temp.equalsIgnoreCase(col)) {
       j++;
     }
   }
   colIndex = new int[j];
   j = 0;
   for (int i = ExcelUtils.getFirstRowNum(); i < totalCol; i++) {
     temp = ExcelUtils.getCellData(1, i).replace(" ", "");
     col = colName.replace(" ", "");
     if (temp.equalsIgnoreCase(col)) {
       colIndex[j] = i;
       j++;
     }
   }
   return colIndex;
 }
コード例 #3
0
 public static int getbkClassRows(String sTestCaseName, int colNum, int start, int end)
     throws Exception {
   int i;
   try {
     for (i = start; i < end; i++) {
       if (ExcelUtils.getCellData(i, colNum).equalsIgnoreCase(sTestCaseName)) {
         break;
       }
     }
     return i;
   } catch (Exception e) {
     Log.error("Class ExcelUtil | Method getRowContains | Exception desc : " + e.getMessage());
     throw (e);
   }
 }
コード例 #4
0
  public static int getRowContains(String searchString, int colNum) throws Exception {
    int i;

    try {
      int rowCount = ExcelUtils.getRowUsed();
      for (i = 0; i < rowCount; i++) {
        if (ExcelUtils.getCellData(i, colNum).equalsIgnoreCase(searchString)) {
          break;
        }
      }
      return i;
    } catch (Exception e) {
      Log.error("Class ExcelUtil | Method getRowContains | Exception desc : " + e.getMessage());
      throw (e);
    }
  }
コード例 #5
0
  public static String[] getXlsRowData(int iTestRowNum, int Total_Col) throws Exception {

    String[] testData = new String[Total_Col];
    int i;
    try {
      for (i = 0; i < testData.length; i++) {
        testData[i] = ExcelUtils.getCellData(iTestRowNum, i);
        //	System.out.println(testData[i]);
      }
      return testData;
    } catch (Exception e) {
      Log.error("Class ExcelUtil | Method getRowUsed | Exception desc : " + e.getMessage());
      //	System.out.println(e.getMessage());
      throw (e);
    }
  }
コード例 #6
0
 // Find Function for Searching the value in  Admin validation xls --- Dom
 public static int[][] getTotalRowContains(String searchString, int colNum) throws Exception {
   int i;
   try {
     int rowCount = ExcelUtils.getRowUsed();
     int count = 0;
     int[][] arr = new int[1][3];
     for (i = 0; i < rowCount; i++) {
       if (ExcelUtils.getCellData(i, colNum).equalsIgnoreCase(searchString)) {
         count++;
       }
     }
     arr[0][0] = count;
     arr[0][1] = ExcelUtils.getRowContains(searchString, colNum);
     arr[0][2] = arr[0][1] + count;
     return arr;
   } catch (Exception e) {
     Log.error("Class ExcelUtil | Method getRowContains | Exception desc : " + e.getMessage());
     throw (e);
   }
 }
コード例 #7
0
  public static String[][] geteUpgradeTestData(int col) throws Exception {

    try {
      int row = ExcelUtils.getRowUsed();
      String[][] testData = new String[row - 1][col];
      int i, j;
      // System.out.println("row -->"+row);
      for (i = 0; i < row - 1; i++) {
        for (j = 0; j < col; j++) {
          testData[i][j] = ExcelUtils.getCellData(i + 2, j);
          //	Log.info("i-->"+i+" j---"+j+" --->"+testData[i][j]);

        }
      }
      return testData;
    } catch (Exception e) {
      Log.error("Class ExcelUtil | Method getRowUsed | Exception desc : " + e.getMessage());
      //	System.out.println(e.getMessage());
      throw (e);
    }
  }
コード例 #8
0
 public static String[] getRowData(int colNo) throws Exception {
   String[] temp = new String[ExcelUtils.getRowUsed()];
   for (int i = 0; i < temp.length; i++) temp[i] = ExcelUtils.getCellData(i, colNo);
   return temp;
 }