I use Robot Framework to automatically check the number of TD or TR in a table.
I use the Get Matching Xpath Count keyword from Selenium, however it always fails with an error.
My HTML code structure:
<table id="myTable"> <tr> <td style="width: 50%">my td</td> <td style="width: 50%">my td</td> </tr> <tr> <td style="width: 50%">my td</td> <td style="width: 50%">my td</td> </tr> <tr> <td style="width: 50%">my td</td> <td style="width: 50%">my td</td> </tr> <tr> <td>Search me</td> <td>Pagination here</td> </tr> </table>
I use the keyword with Xpath: .// [@ id = 'myTable'] / tr / td / @ width
Because I just want to count td with width attribute.
and error: InvalidSelectorException: Message: u "invalid selector: Unable to find element with xpath expression ...
Any solution? thanks
source share