public static String getLabelForElement(WebElement s, int id){
        String ans, text;
        Point sLocation;
        List<WebElement> webElements;

        if (labels.get(s.getAttribute("id"))!=null && !labels.get(s.getAttribute("id")).equals("")){
            return labels.get(s.getAttribute("id"));
        }

        sLocation = s.getLocation();
        ans = "-";
        r = 10000;
        x = sLocation.getX();
        y = sLocation.getY();

        webElements = s.findElements(By.xpath(".//preceding-sibling::* | .//ancestor::label | //h1 | //h2 | //h3"));

        ans = findTextInList(webElements, ans);

        if(ans.equals("-") || s.getTagName().equals("input")){
            text = s.getAttribute("value");
            if (text!=null && !text.equals("") && !text.matches("^[0-9\\s]+$")){
                return text;
            }
            else{
                return ans;
            }
        }
        return ans;
    }