Quality Testing

Quality is delighting customers

No Description

Views: 267

Reply to This

Replies to This Discussion

Hi first get the size of the pagination, based on that size we can loop the pagination as like as below,

List pagination =driver.findElements(By.xpath("//div[@class='pagination cm-pagination-wraper center']//a")); 
int size= pagination.size(); 
System.out.println(pagination.size()); 
if(size>0) 
System.out.println("pagination exists");
// click on pagination link
    for(int i=2; i<size; i++){ 
         try{ 
driver.findElement(By.xpath("//div[@class='pagination cm-pagination-wraper center']//a["+i+"]")).click() ;
Thread.sleep(5000); 
System.out.println("Loop "+i);
}
catch(Exception e){ 
e.printStackTrace(); 

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2017   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service