-1
public LinkedHashMap<String, Object> getLeadAverageDistance() throws Exception {
    LinkedHashMap<String, Object> leadAverageDistanceUI = new LinkedHashMap<>();
    Reporter.log("----------------------------------------------------------------------------");
    Reporter.log("Actual Result");
    leadAverageDistanceUI.put(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_DEALER, getDealer());
    Reporter.log(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_DEALER + getDealer());

    leadAverageDistanceUI.put(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_NATION_AVG,  getNationAvg());
    Reporter.log(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_NATION_AVG + getNationAvg());

    leadAverageDistanceUI.put(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_MARKET_AVG,  getMarketAvg());
    Reporter.log(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_MARKET_AVG + getMarketAvg());

    leadAverageDistanceUI.put(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_REGION_AVG, getRegionAvg());
    Reporter.log(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_REGION_AVG + getRegionAvg());

    leadAverageDistanceUI.put(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_ZONE_AVG,  getZoneAvg());
    Reporter.log(EDDLeadDetailsConstants.LEAD_AVERAGE_DISTANCE_ZONE_AVG + getZoneAvg());

    Reporter.log("----------------------------------------------------------------------------");
    Reporter.log("");
    return leadAverageDistanceUI;
}

public int getDealer() throws Exception {
    String dealer = driver.findElement(By.id(eddLeadAverageDistanceRow+"[1]/td[2]")).getText();
    return Integer.valueOf(dealer.replace("%", "").trim());
}   

public int getNationAvg() throws Exception {
    String nationalavg = driver.findElement(By.xpath(eddLeadAverageDistanceRow+"[2]/td[2]")).getText();
    return Integer.valueOf(nationalavg.replace("%", "").trim());
}
public int getMarketAvg() throws Exception {
    String marketavg = driver.findElement(By.xpath(eddLeadAverageDistanceRow+"[3]/td[2]")).getText();
    return Integer.valueOf(marketavg.replace("%", "").trim());
}
public int getRegionAvg() throws Exception {
    String regionavg = driver.findElement(By.xpath(eddLeadAverageDistanceRow+"[4]/td[2]")).getText();
    return Integer.valueOf(regionavg.replace("%", "").trim());
}
public int getZoneAvg() throws Exception {
    String zoneavg = driver.findElement(By.xpath(eddLeadAverageDistanceRow+"[5]/td[2]")).getText();
    return Integer.valueOf(zoneavg.replace("%", "").trim());
}

closed as unclear what you're asking by Bence Kaulics, trashpanda, Alexey R., Kevin McKenzie, Ray Oei Jan 14 at 15:48

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Try to be specific in your questions. What error are you getting? What is the value of eddLeadAverageDistanceRow? – Shahid Jan 14 at 7:21