title: Selenium Webdriver wait for button text to change
body: <p>I am trying to automate a scenario (in Ruby) where button initial text is 'Activate', once it is clicked, it takes 3-5 seconds to do what ever necessary then the button text changes to 'Deactivate'.  </p>
  
  <p>Because the button always exist, using following code does not help.</p>
  
  <pre><code>wait.until {
    driver.find_element(:id =&gt; 'changeStatus')
  }
  </code></pre>
  
  <p>How can i ask webdriver to wait for 5 seconds before checking the button text after clicking. </p>