When I click on a button, a bootstrap modal popup displays. I tried to click on the OK or cancel button using Poltergeist functions as below, but none worked. Either the functions doesn't work or clicks outside.
<div class="modal-footer">
<a class="btn cancel" data-dismiss="modal" href="#">Cancel</a>
<a class="btn proceed btn-primary" href="#">OK</a>
</div>
click_link "Release"
page.driver.render('ReleaseOKCANCEL.jpg', :full =>true)
On Clicking 'release', there will be a bootstrap modal with OK and cancel buttons, which can be verified with the screenshots. Trying to click on OK button with the below commands.
- page.find('.btn.proceed.btn-primary').trigger('click')
- click_link('OK')
- page.execute_script('$(".btn.proceed.btn-primary").trigger("click")')
- page.execute_script('$(".btn.proceed.btn-primary").trigger("hover").trigger("click")')
- page.all(".//*[@id='confirmation_dialog']/div[3]/a[2]").first.click
- click_button "OK"
- click_on "OK"
- page.dismiss_confirm do page.find('.btn.proceed.btn-primary').click end
- page.find('.modal').find('.modal-footer').find('.btn.proceed.btn-primary').trigger('click')
But nothing works. There will be a status change in the application after clicking on OK button. But that doesn't happen.