title: Wait until button is clicked in Selenium WebDriver to click on next button?
body: <p>I'm at the point in my program where it will click a button within the browser and within that page, another button should appear.  After that button appears, my program will immediately run the next action to click the next button.  I'm getting this error currently:</p>
  
  <blockquote>
    <p>ElementNotVisibleException: Message: element not visible</p>
  </blockquote>
  
  <p>Therefore, I'm assuming I'm calling the action to click the next button before that button appears.  My question is what would I do to make my program wait until I can click on the button, to click on the button?</p>
  
  <pre><code>driver.find_element_by_xpath('//*[@id="add-remove-buttons"]/input').click()
  driver.find_element_by_xpath('//*[@id="cart"]/a[2]').click()
  </code></pre>
  
  <p>This is what the code looks like at the bottom of my program.  I need to be able to wait until the second action is possible to complete the second action.  Thanks for all the help!</p>