0

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.

1 Answer 1

0

While statement should begin with a lowercase w.

while(tr.hasNext()) { //getting compilation error here, asking to add ;
    System.out.println("index" + tr.nextIndex() + "value" + tr.next());
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.