Categories

1 Answer

Aug 22, 2019
// To store the list

List <WebElement> eleList = driver.findElements(By.xpath("xpath"));

// To fetch the size of the list

int listSize = eleList.size();

//for loop

for (int i=0; i<listSize; i++)

{

// Clicking on each link

links.get(i).click();

// Navigating back to the previous page that stores the links

driver.navigate().back();

}

1

2

3

4

5

6

7

8

9

10

11

12

// To store the list

List <WebElement> eleList = driver.findElements(By.xpath("xpath"));

// To fetch the size of the list

int listSize = eleList.size();

//for loop

for (int i=0; i<listSize; i++)

{

 // Clicking on each link

 links.get(i).click();

 // Navigating back to the previous page that stores the links

 driver.navigate().back();

}
Click here to read more about Selenium
Click here to read more about Insurance

Related questions

Madanswer
Aug 22, 2019 in Selenium
Aug 19, 2019 in Selenium
Aug 22, 2019 in Selenium
...