ダイナミックテーブルが1つあります。 in row = 1 and column = 3セルの値は2です。xpath、id、nameなどはわかりません。セルテーブルの1つのセルからid、xpah、nameなどのようなロケータを使用せずに1つの要素を見つける方法
どのようにしてtdとtrを使うことができますか?
サンプルテーブル
WebElement table= driver.findElement(By.id("table"));
/* List of all rows*/
List< WebElement> rows = table.findElement(By.tagName("tr"));
int row_count = rows.size();
/*Looping rows*/
for(int i=0;i< row_count;i++)
{
/* List all columns*/
List < WebElement> columns = rows.findElement(By.tagName("td"));
int column_count= columns.size();
for(int j=0;j< column_count ; j++)
{
String celltext= columns.get(j).getText();
System.out.println(celltext); ///This will print all values inside the table.
////But I want only one value from one cell, suppose from first row and third column
}
}
試したサンプルコードを追加してください。 – Jay