find data in table with selenium

  • 1 Replies
  • 802 Views
find data in table with selenium
« on: May 31, 2016, 21:03:50 pm »
Code
<div id="itemsContainer">
    <table class="table">
    </table>
</div

If I want to get the first row of the table
assuming rows have ids <td row="0"> etc.

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

Re: find data in table with selenium
« Reply #1 on: June 02, 2016, 09:58:01 am »
Try this:

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

 

Sitemap 1 2 3 4 5 6 7 8