code: @Override
      public List<String> getTableHeaders() throws WidgetException {
          List<String> list = new ArrayList<String>();
  
          try {
  
              NodeList nodes = getNodeListUsingJavaXPath(getTableXPath(generateXPathLocator())
                      + "//thead[not(contains(@style,'display: none') or contains(@style,'visibility: hidden'))]//th");
              if (nodes.getLength() == 0) {
                  nodes = getNodeListUsingJavaXPath(getTableXPath(generateXPathLocator()) + "//th");
              }
  
              if(nodes.getLength() == 0) {
                  throw new WidgetException("Table headers do not exist", generateXPathLocator());
              }
  
              for (int i = 0; i < nodes.getLength(); i++) {
                  Node n = nodes.item(i);
                  if (n != null && n.getNodeName() != null && n.getNodeName() != null) {
                      NamedNodeMap thNodeAttributes = n.getAttributes();
                      Node thStyleAttr = thNodeAttributes.getNamedItem("style");
                      if (thStyleAttr != null) {
                          String style = thStyleAttr.getTextContent();
                          style = style.toLowerCase();
                          if (!(style.contains("display: none") || style
                                  .contains("visibility: hidden"))) {
                              list.add(n.getTextContent().trim());
                          }
                      } else {
                          list.add(n.getTextContent().trim());
                      }
  
                  }
              }
          } catch (Exception e) {
              throw new WidgetException("Error fetching table headers", generateXPathLocator(), e);
          }
  
          return list;
      }
docs: /*
  (non-Javadoc)
  
  @see qc.automation.framework.widget.ITable#getTableHeaders()