title: FirefoxDriver webdriver.load.strategy unstable findelements getting elements from the wrong page
body: <p>I am using FirefoxDriver in an application that rapidly moves through several similar but not identical pages. To speed up the execution (I need to use FF), I set the webdriver.load.strategy property to 'unstable.' This does indeed speed things up by not completely loading pages, but I found a very strange error. </p>
  
  <p>In examining the file with the list of pages and the data on them, I found that some pages were matched up with the wrong data. When I debugged, everything worked fine while stepping, but as soon as I let the program run for even a few pages, it started getting data from the wrong page again. (To clarify, e.g. if I do a <code>driver.get(www.google.com)</code> , followed by <code>driver.get(www.stackoverflow.com)</code>, and then do <code>driver.findElements()</code> to get StackOverflow's page title, it will return "Google.")</p>
  
  <p>When closely watching the browser running, it appeared to me that there was a mismatch between the urls in the url box and the pages actually being displayed. The urls were changing much faster than the page. I suspect that what is happening is that the driver is not waiting until the page is fully loaded before calling findElements and therefore gets elements from the previous page, which have the same class names. </p>
  
  <p>This makes some sense given what webdriver.load.strategy 'stable' is supposed to do, but I set a Wait on an element on the page and it doesn't seem to be waiting. Can it be because every page has the same element, so the element was visible already? I can't wait on anything else because all the pages have the same setup - it's only the individual text that's different, and I don't know what that will be in advance.</p>
  
  <p>Has anyone encountered this problem? Does my assumption about what's causing the problem correct? Is there anything I can do about it short of removing the unstable load strategy?</p>
  
  <p>Thanks, 
    bsg
  <strong>EDIT</strong>
  I am adding some code, even though the code works perfectly when webdriver.load.strategy 'stable' is not set.</p>
  
  <pre><code>for(String url : urllist)
  {
    driver.get(url);
    WebElement header = (new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.tagName("h1")));
    elements = driver.findElements(By.className(elementclassname));
  }
  </code></pre>
  
  <p>Note that there is an h1 and several elements with class=elementclassname on each page.</p>