title: Issue waiting for element to load using selenium in Java
body: <p>I am trying to use Selenium to find a webElement on a page that is loaded using ajax and/or jquery.</p>
  
  <p>It seems no matter what I do, the element is never found.</p>
  
  <p>I am using Firefox 20, and Selenium 2.31.0.</p>
  
  <p>That section that I am trying to get has html that looks like this (I got this using the Inspector Tool in firefox):</p>
  
  <pre><code> &lt;form id="file_upload" method="post" enctype="multipart/form-data" action="myAction.php"&gt;
      &lt;table class="table table-striped"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td&gt;
              &lt;input class="input-file" type="file" name="file"&gt;&lt;/input&gt;
              &lt;input class="btn btn-primary" type="submit" value="upload"&gt;&lt;/input&gt;
            &lt;/td&gt;
            &lt;td style="text-align:right;"&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>I have tried: </p>
  
  <pre><code>WebDriverWait driverWait = new WebDriverWait(driver, 10000);
  
  WebElement dynamicElement =  driverWait.until(ExpectedConditions.presenceOfElementLocated(By.id("file_upload")));
  
  System.out.println(dynamicElement.getText());
  </code></pre>
  
  <p>and I have tried:</p>
  
  <pre><code>WebElement dynamicElement = new FluentWait&lt;WebDriver&gt;(driver).withTimeout(1,  TimeUnit.MINUTES).pollingEvery(1, TimeUnit.SECONDS)
      .ignoring(NoSuchElementException.class).until(ExpectedConditions.visibilityOfElementLocated(By.id("file_upload")));
  
  System.out.println(dynamicElement.getText());
  </code></pre>
  
  <p>But anything I try never finds it, or times out no matter how much time I give it to find that element.  Any help would be much appreciated.  Thankyou.</p>