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.

asked Jul 9, 2019 at 11:44

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());
}
answered Jul 9, 2019 at 14:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.