title: Phantomjs' selenium Ajax code not loaded
body: <p>I just discovered Selenium and I'm trying to learn how to use it with PhantomJS. The first example I've found was about getting a list of links from booking.com.
  I tried running it with PhantomJS without luck. Firefox runs it well. The code in java looks like this:</p>
  
  <pre><code>private void start() {
      Capabilities caps = new DesiredCapabilities();
  
      ((DesiredCapabilities) caps).setJavascriptEnabled(true);
      ((DesiredCapabilities) caps).setCapability("takesScreenshot", true);
      ((DesiredCapabilities) caps).setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,                       "D:\\phantomjs-2.0.0-windows\\bin\\phantomjs.exe");
      //WebDriver driver = new PhantomJSDriver(caps);
      WebDriver driver = new FirefoxDriver();
  
      driver.get("http://www.booking.com");
      driver.findElement(By.id("destination")).sendKeys("Berlin");
      //saveSShot(driver, "sel1.png");
      long timeOut = 5000;
      long end = System.currentTimeMillis() + timeOut;
  
      while (System.currentTimeMillis() &lt; end) {
  
          if (String.valueOf(
                  ((JavascriptExecutor) driver)
                          .executeScript("return document.readyState"))
                  .equals("complete")) {
              break;
          }
      }
      //saveSShot(driver, "sel2.png");
      try {
          //writeFile(driver, "output1.txt");
          new WebDriverWait(driver, 3).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("ul.ui-autocomplete li a"))).click();
          //writeFile(driver, "output2a.txt");
          //saveSShot(driver, "sel3.png");
          driver.findElement(By.name("idf")).click();
          driver.findElement(By.className("b-searchbox-button")).submit();
  
          List&lt;WebElement&gt; list = driver.findElements(By
                  .cssSelector("a.hotel_name_link"));
          for (WebElement webElement : list) {
              System.out.println(webElement.getText());
          }
      } catch (TimeoutException e) {
          System.out.println(e.toString());
          //writeFile(driver, "output.txt");
      }
  }
  </code></pre>
  
  <p>Note the two declarations of driver. If I use Firefox, the WebDriverWait works. On PhantomJS it gives an error with WebDriverWait (Element not found  :262 in error)</p>
  
  <p>I have added all code. You can paste it in a new project, add the class and includes and you'll see how it (not) work. The two commented method saveSShot and writeFile must be written. I used them for debugging purposes. What I see on the second screenshot is that "Berlin" is in fact written, but the ajax dropdown isn't there. With Firefox it appears.</p>