title: Unable to click on a popup with id's using selenium webdriver and ruby
body: <p>Following is the code i am using  </p>
  
  <pre><code>def self.yes_publish
        sleep 5
        driver.find_element(:id, 'dialogConfirmChanges-publishButton').displayed?
        WAIT.until { driver.find_element(:id, 'dialogConfirmChanges-publishButton') }.click        
        puts driver.find_element(:id, 'embed-left-center-part').displayed?
       end
  </code></pre>
  
  <p>But i am unable to click on it. This id works fine in irb.
  I get an error modal dialog present, as webdriver is unable to locate element it closes to window after a particular timeout. 
  This popup is to publish changes made on a page. </p>
  
  <pre><code>xpath = .//*[@id='dialogConfirmChanges-publishButton']
  </code></pre>