title: Search an element in all pages in Selenium WebDriver (Pagination)
body: <p>I need to search for particular text in a table on all the pages. Say i have got to search for text (e.g : "xxx") and this text is present at 5th row of table on 3rd page.
  I have tried with some code :</p>
  
  <pre><code>List&lt;WebElement&gt; allrows = table.findElements(By.xpath("//div[@id='table']/table/tbody/tr"));
  List&lt;WebElement&gt; allpages = driver.findElements(By.xpath("//div[@id='page-navigation']//a"));
      System.out.println("Total pages :" +allpages.size());
      for(int i=0; i&lt;=(allpages.size()); i++)
          {
              for(int row=1; row&lt;=allrows.size(); row++)
                  {
                      System.out.println("Total rows :" +allrows.size()); 
                      String name = driver.findElement(By.xpath("//div[@id='table']/table/tbody/tr["+row+"]/td[1]")).getText();
                      //System.out.println(name);
                      System.out.println("Row loop");
                      if(name.contains("xxxx"))
                          {
                              WebElement editbutton = table.findElement(By.xpath("//div[@id='table']/table/tbody/tr["+row+"]/td[3]"));
                              editbutton.click();
                              break;
                          }
                      else
                      {
                          System.out.println("Element doesn't exist");
                      }
                      allpages = driver.findElements(By.xpath("//div[@id='page-navigation']//a"));
                  }
  
              allpages = driver.findElements(By.xpath("//div[@id='page-navigation']//a"));
              driver.manage().timeouts().pageLoadTimeout(5, TimeUnit.SECONDS);
              allpages.get(i).click();
          }
  </code></pre>
  
  <p>Sorry, i missed to describe the error.  Well this code gets executed properly, it checks for element "xxx" on each row of every page and clicks on editbutton when its found. </p>
  
  <p>After that it moves to 
    "allpages.get(i).click();" // code is for click on pages</p>
  
  <p>But its unable to find any pagination, so it displays error of "Element is not clickable at point (893, 731). Other element would receive the click...."</p>