yandex-qatools/htmlelements

Ability to find elements in Class Table shall be improved

IgorBM opened this issue · 2 comments

I have to test a table with the following structure:

<table>
     <thead>
        <tr>
           <th/>
           <th/>
           ....
           <th/>
        </tr>
    <thead/>
    <tfoot>
        <tr>
           <td/>
        </tr>  
   </tfoot>
  <tbody>
        <tr>
           <td/>
           <td/>
           ....
           <td/>
        </tr>
  </tbody>

Thus, when I declare it like:

  @FindBy(xpath = "//table")
    private Table rosterTable;

In case of empty table with a single row to be filled, I've got 3 rows - one for header, one for footer, 8 for tbody and it fails with this error on the line 143 in Table.java:

        for (List<WebElement> row : rows) {
            if (row.size() != headings.size()) {
                throw new HtmlElementsException("Headings count is not equal to number of cells in row");
            }

Could you introduce some flexibility to handle such table structures, so rows are being located under tbody, for example?

I can't find code you are talking about in htmlelements codebase. Which version do you use?

Sorry. It seems I was using the version 1.14 and in 1.15 you have resolved this issue already. Thanks for the hint!