title: Trying to click a button on a simple modal window using capybara, cucumber and selenium
body: <p>The website I am testing submits a form, once the form is submitted a simple modal window displays to thank the user with a close button.  I can't find a way to click that close button for some reason.  </p>
  
  <p>Here is the code for the modal window:</p>
  
  <pre><code>&lt;div id="simplemodal-container" class="simplemodal-container" style="position: fixed; background-color: rgb(255, 255, 255); border: 3px solid rgb(102, 102, 102); padding: 30px; width: 380px; height: 270px; z-index: 1002; left: 409px; top: 63.5px;"&gt;
      &lt;div tabindex="-1" class="simplemodal-wrap" style="height: 100%; outline: 0px; width: 100%; overflow: visible;"&gt;
          &lt;div id="leadconfirm" class="overlaycontent simplemodal-data" style=""&gt;
              &lt;span class="popupheader"&gt;Talk to a&lt;/span&gt;
              &lt;div class="indent"&gt;
                  &lt;p class="bold"&gt;Thank you! You'll be hearing from us very soon.&lt;/p&gt;
              &lt;/div&gt;
          &lt;div class="buttonRow"&gt;
              &lt;input id="registrationclose" class="simplemodal-close btn submitBut" type="submit" value="Close" name="close"&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>I have tried the following step definitions, the ones that are commented out I tried previously.</p>
  
  <pre><code>When /^I click on the xpath "([^\"]*)" button$/ do
  
  find('button', :text =&gt; 'close')
  
  #within("simplemodal-container")   { click_on button_name }
  
  #find(:xpath,".//*[@id='registrationclose']").click_on button_id
  
  # page.driver.browser.switch_to.alert.accept
  
  end
  
  When /^I click on the "([^"]*)" button$/ do |button_value|
  click_button button_value
  end
  </code></pre>