title: Keep on refreshing the page until certain element to appear?
body: <p>I have a scenario like, i want to keep on refreshing the page until some element to appear in the page. Can anyone please help me on the same?</p>
  
  <p>I am using the below code for the same but the page is not refreshing after five second</p>
  
  <pre><code>Wait&lt;WebDriver&gt; wait = new FluentWait&lt;WebDriver&gt;(driver)
                 .withTimeout(30, TimeUnit.SECONDS)
                 .pollingEvery(5, TimeUnit.SECONDS)
                 .ignoring(NoSuchElementException.class);
  
             WebElement foo = wait.until(new Function&lt;WebDriver, WebElement&gt;() {
               public WebElement apply(WebDriver driver) {
                 return driver.findElement(locator);
               }
             });
  </code></pre>
  
  <p>Thanks </p>
  
  <p>Sudhansu</p>