title: handle refreshing WebElement with Selenium
body: <p>I'm testing a Website consisting of multiple frames. The server can regenerate a frame at any time, even if no element changed. If this happens during</p>
  
  <pre><code>driver.findElement(By.id("11")).getText();
  </code></pre>
  
  <p>between findElement and getText, a StaleElementExcpetion is thrown. My current solution is to retry multiple times.</p>
  
  <pre><code>for (int i = 0; i &lt; 3; i++) {
      try {
          driver.findElement(By.id("11")).getText();
  
      } catch (StaleElementException e) {
          // retry
      }    
  }
  </code></pre>
  
  <p>This realy bloats the code, any better solution?</p>