title: Waiting for a chart to refresh, selenium Java
body: <p>I'm trying to find an appropriate ExpectedConditions method for this situation. I have a chart and I want to check the text in each row after re-sorting the chart. Problem is, when the chart is refreshing, the text still exists, it's just greyed out. So when I click a button to get the chart to be re-sorted, then look for the text that I'm looking for right away, the test fails because the text hasn't changed yet. I can't use visibilityOfElementLocated because the element is still visible when the chart is refreshing, I'm just waiting for the element to change.</p>
  
  <p>Not sure if any of that makes sense!! It is a really difficult issue to explain.</p>
  
  <p>A little background: I'm using Selenium Java and testing using Chrome. Here is my method thus far. It works fine, I just need to figure out how to make the program wait long enough for the chart to refresh WITHOUT using a sleep statement.</p>
  
  <p>Thanks a bunch everyone! I know that wasn't as clear as it could be, but please let me know if you need any clarification.</p>
  
  <pre><code>public void Check_for_text_in_column(String text, String row, String column)
  {
      By by = By.xpath("//*[@id=\"table_Table_table_ktg\"]/tbody/tr[" + row + "]/td[" + column + "]/div/div/span");
      WebDriverWait wait = new WebDriverWait(getWebDriver(), WAIT_TIME);
  
      //This is the line that I need to change: 
      WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(by));
  
      if(!element.getText().equals(text))
      {
          fail("\nDid not find text: " + text + "\nFound text: " + element.getText() + "\n");
      }
  }
  </code></pre>
  
  <p>Cheers!</p>