示例#1
0
  // to get the flag row count
  public static List<String[]> flagRowCount(String script_name) throws IOException {
    // "D:\\akash\\salenium\\Reach_OAMC\\Excel-files\\01_Reachwell_masters_currency_Data.xls"
    ExcelReadWrite x =
        new ExcelReadWrite(
            System.getProperty("user.dir")
                + "\\Excel_sheets\\Masters\\01_Reachwell_masters_currency_Data.xls");
    HSSFSheet create_curr = x.Setsheet("create_curr");
    int xlRowcount = x.getrowcount(create_curr);

    // Declare a Array List
    List<String[]> List_login = new ArrayList<String[]>();

    // traversing Excel
    for (int xlRow = 1; xlRow <= xlRowcount; xlRow++) {

      String Execute_Flag = x.Readvalue(create_curr, xlRow, "Execute_Flag");
      String Scriptname = x.Readvalue(create_curr, xlRow, "Scriptname");

      if ((Execute_Flag.equals("Y") && (Scriptname.equals(script_name)))) {

        String[] arr_login = new String[4];

        arr_login[0] = x.Readvalue(create_curr, xlRow, "TC_ID");
        arr_login[1] = x.Readvalue(create_curr, xlRow, "Order");
        arr_login[2] = x.Readvalue(create_curr, xlRow, "curr_name");
        // arr_login[3]=x.Readvalue(create_curr, xlRow, "Pwd");
        arr_login[3] = x.Readvalue(create_curr, xlRow, "Exp_Res");

        List_login.add(arr_login);
      } // end of if
    } // end of for

    return List_login;
  }
  public static List<String[]> flagRowcount(String script_name) throws IOException {
    ExcelReadWrite x = new ExcelReadWrite("D:\\BSI\\TestData\\Test_Data.xls");
    HSSFSheet Scenario_Search = x.Setsheet("Scenario_Search");
    int xlRowcount = x.getrowcount(Scenario_Search);

    // Declare
    List<String[]> List_Search = new ArrayList<String[]>();

    for (int xlrow = 1; xlrow <= xlRowcount; xlrow++) {
      String Execute_Flag = x.Readvalue(Scenario_Search, xlrow, "Execute_Flag");
      String Scriptname = x.Readvalue(Scenario_Search, xlrow, "Scriptname");

      if ((Execute_Flag.equals("Y") && (script_name.equals(Scriptname)))) {
        String[] arr_Search = new String[4];
        arr_Search[0] = x.Readvalue(Scenario_Search, xlrow, "TC_ID");
        arr_Search[1] = x.Readvalue(Scenario_Search, xlrow, "Order");
        arr_Search[2] = x.Readvalue(Scenario_Search, xlrow, "Search_Item");
        arr_Search[3] = x.Readvalue(Scenario_Search, xlrow, "Exp_Res");
        arr_Search[3] = arr_Search[3].replace(".0", "");
        List_Search.add(arr_Search);
      }
    } // end of the for loop

    return List_Search;
  }