title: Selenium Webdriver wait.until is not working
body: <p>So I am starting to use Selenium Webdriver and I am encountering a problem with the <strong>until</strong> method from selenium.webdriver.support.wait. Below is my code:</p>
  
  <pre><code>from selenium import webdriver
  import time
  from selenium.webdriver.support.select import Select
  from selenium.webdriver.support.wait import WebDriverWait
  
  
  url = "http://shop.uclastore.com/courselistbuilder.aspx"
  
  driver = webdriver.Firefox()
  driver.get(url)
  time.sleep(1)
  
  departments = Select(driver.find_element_by_id('clDeptSelectBox'))
  for department in departments.options:
      # select department
      departments.select_by_value(department.get_attribute('value'))
  
  
      elem = driver.find_element_by_xpath("//select[@id='clCourseSelectBox']//option")
      print elem
      print elem.get_attribute('value')
  
      wait = WebDriverWait(driver, 10, 1.0)
      wait.until(lambda driver: driver.find_element_by_xpath("//select[@id='clCourseSelectBox']//option"))
  
      # time.sleep(1)
  
      elem = driver.find_element_by_xpath("//select[@id='clCourseSelectBox']//option")
      print elem
      print elem.get_attribute('value')
      print
  </code></pre>
  
  <p>The problem is that when I print out the statements before and after I get:</p>
  
  <pre><code>&lt;selenium.webdriver.remote.webelement.WebElement object at 0x108a4af50&gt;
  0
  &lt;selenium.webdriver.remote.webelement.WebElement object at 0x108a4af90&gt;
  0
  
  &lt;selenium.webdriver.remote.webelement.WebElement object at 0x108a4afd0&gt;
  0
  &lt;selenium.webdriver.remote.webelement.WebElement object at 0x108a4af10&gt;
  0
  </code></pre>
  
  <p>where as when I comment out the <strong>wait.until</strong> code and uncomment the <strong>time.sleep</strong>, I get the following:</p>
  
  <pre><code>&lt;selenium.webdriver.remote.webelement.WebElement object at 0x10378de90&gt;
  0
  &lt;selenium.webdriver.remote.webelement.WebElement object at 0x10378de50&gt;
  84082
  
  &lt;selenium.webdriver.remote.webelement.WebElement object at 0x10378df90&gt;
  0
  &lt;selenium.webdriver.remote.webelement.WebElement object at 0x103767110&gt;
  87846
  </code></pre>
  
  <p>So far, one possibility that I was thinking was that wait already found the <strong>elem</strong> which would imply that we should not get a zero value for the second print statement. However, that is not the case. So currently I do not know what is happening and need some help to figure it out.</p>