Ejemplo n.º 1
0
  /**
   * 获取<thead>元素
   *
   * @return
   */
  private WebElement getTHead() {
    if (null == this.thead) {
      try {
        this.thead = this.findElement(By.xpath(HtmlTags.THEAD));
      } catch (NotFoundException ex) {
        if (this.logger.isDebugEnabled()) {
          this.logger.debug(ex.getMessage(), ex);
        }
      }
    }

    return this.thead;
  }
Ejemplo n.º 2
0
  /**
   * 获取<tfoot>元素
   *
   * @return
   */
  private WebElement getTFoot() {
    if (null == this.tfoot) {
      try {
        this.tfoot = this.findElement(By.xpath(HtmlTags.TFOOT));
      } catch (NotFoundException ex) {
        if (this.logger.isDebugEnabled()) {
          this.logger.debug(ex.getMessage(), ex);
        }
      }
    }

    return this.tfoot;
  }
Ejemplo n.º 3
0
  /**
   * 获取<tbody>元素
   *
   * @return
   */
  private WebElement getTBody() {
    if (null == this.tbody) {
      try {
        this.tbody = this.findElement(By.xpath(HtmlTags.TBODY));
      } catch (NotFoundException ex) {
        if (this.logger.isDebugEnabled()) {
          this.logger.debug(ex.getMessage(), ex);
        }
      }
    }

    return this.tbody;
  }
Ejemplo n.º 4
0
  @Override
  public List<ITableRow> findBodyRows(ITableRowLocator locator) {
    List<ITableRow> result = new ArrayList<ITableRow>();

    for (int i = 0; ; i++) {
      ITableRow row = null;
      try {
        row = this.getBodyRow(i);
      } catch (NotFoundException ex) {
        if (this.logger.isDebugEnabled()) {
          this.logger.debug(ex.getMessage(), ex);
        }
        // 代表超过行数了
        break;
      }

      if (locator.isTarget(row)) {
        result.add(row);
      }
    }

    return result;
  }