rows_table = Table_element.findElements(By.tagName("tr"));//To calculate no of rows In table.int rows_count = rows_table.size();//Loop will execute till the last row of table.for (int row = 0; row < rows_count; row++) {//To locate columns(cells) of that specific row.List < WebElement > Columns_row = rows_table.get(row).findElements(By.tagName("td"));//To calculate..." />

How to get a cell selected by a specific column value in selenium

I need to select the cell with order id #1968 for a dynamic table.

I have printed the table using code below , Please suggest how I can get the specific cell with value #1968 selected ?

WebElement Table_element =commonFunctions.driver.findElement(By.xpath("//*[@id='active']/div/table"));

//To locate rows of table.

List < WebElement > rows_table = Table_element.findElements(By.tagName("tr"));

//To calculate no of rows In table.

int rows_count = rows_table.size();

//Loop will execute till the last row of table.

for (int row = 0; row < rows_count; row++) {

//To locate columns(cells) of that specific row.

List < WebElement > Columns_row = rows_table.get(row).findElements(By.tagName("td"));

//To calculate...

Read More »

By: StackOverFlow - 6 days ago

Related Posts