You need to refresh until the required element is found. Try the below code :
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
while(true) {
try {
WebElement element = driver.findElement(By); // Find the element, you required
if(element.isDisplayed()) { // Check if the required element is present
break;
}
} catch(Exception e) {
driver.navigate().refresh();
}
}
You will come out of the loop, if you find the required element. After this, you can continue with the rest of the flow.