TestProject Forum
Powered by leading experts in the test automation community

Find data in table with selenium

<div id="itemsContainer">
    <table class="table">
    </table>
</div

If I want to get the first row of the table
assuming rows have ids

etc.

Can I get item from table at row = n , column = m ?

Try this:

WebElement table = driver.findElement(By.id("itemsContainer"));
List<WebElement> tableRows = table.findElements(By.tagName("tr"));
tableRows.get(0).getText();