I am getting compilation error when trying to store list size value into an int.
public class HandleWebTable {
private static WebDriver driver;
public HandleWebTable(){
super();
}
public static void printAllHeaderOfWebTable() {
List<WebElement> allHeaderTable=driver.findElements(By.xpath("//div[@class='panel history-panel panel panel-default']"));
int allHeaderSize=allHeaderTable.size();
ListIterator<WebElement> tr=allHeaderTable.listIterator();
System.out.println("Traverse in forwrd direction");
While(tr.hasNext()) { //getting compilation error here, asking to add ;
System.out.println("index" + tr.nextIndex() + "value" + tr.next());
}
please help what should be the right approach to get the rows and columns of webtable.