code: public String getXPathBase() {
          String xPathBase = "";
          if (this.getElement() != null) {
  
              String locator = getLocator();
              if (!locator.startsWith("link=") && !locator.startsWith("xpath=") && !locator.startsWith("/")) {
                  if (locator.startsWith("id=") || locator.startsWith("name=")) {
                      String tmp = locator.substring(locator.indexOf('=', 1) + 1);
                      if (locator.startsWith("id=")) {
                          xPathBase = "//table[@id='" + tmp + "']/tbody/";
                      } else {
                          xPathBase = "//*[@name='" + tmp + "']/tbody/";
                      }
  
                  } else {
                      xPathBase = "//*[@id='" + locator + "']/tbody/";
                  }
  
              } else {
                  if (locator.startsWith("xpath=")) {
                      locator = locator.substring(locator.indexOf('=', 1) + 1);
                  }
  
                  if (HtmlElementUtils.locateElements(locator + "/tbody").size() > 0) {
                      xPathBase = locator + "/tbody/";
                  } else {
                      xPathBase = locator + "//";
                  }
              }
          } else {
              throw new NoSuchElementException("Table" + this.getLocator() + " does not exist.");
          }
          return xPathBase;
      }
docs: Generates xPath from element locator and path to the row (&lt;tr&gt; tag)<br>
  Checks if table has &lt;TBODY&gt; tag and adds it to the xPath<br>
  
  @return String with beginning of xPath<br>