1

Just wondering if anyone had any experience using the selector in testcafe to find the col & row

I would like to select this element by row and col, is this possible.

<td class="text-left" style="background: #5594AA;margin: 0px;padding: 0px;" row="0" col="Monday"><!--!--><!--!--><!--!-->        <button class="btn btn-sm dx-btn dx-btn-text rtv-cell-filling-button" id="id892d282d-3723-4a09-b708-913a7f76814c" type="button"><!--!-->
            <!--!--><div><!--!--><i class="far fa-sun" aria-hidden="true"></i>09:00 - 17:00</div><!--!-->
        </button><!--!-->
</td> 
Martin H.
  • 538
  • 1
  • 7
  • 21

1 Answers1

2

Generally spoken, you can select an element by any attribute that an DOM element has via TestCafe's Selectors. To select the given tabledata element by multiple attributes, you could make use of how CSS-Selectors select elements with multiple attributes:

const myTableDataSelector = Selector("td[row=0][col=Monday]");

Also see this post on the usage of multiple css selectors to select specific elements.

Martin H.
  • 538
  • 1
  • 7
  • 21