-
-
Notifications
You must be signed in to change notification settings - Fork 428
Appropriate usage of accepting JS confirmation alerts? #811
Comments
Hey @sublimecoder. You should provide a block which triggers a modal dialog. For example, if page.accept_confirm { visit ('/') } |
@mhoran Oh ok! That make sense! Just applied that and it worked! Thank you so much! |
@mhoran ... I have tried the same but it didn't work. also send keys builder = page.driver.browser.action But none of them work. I need to click ok or cancel button of the dialog window.Please help |
Hey @ramugogurla. Are you sure you're using capybara-webkit? You're using some Selenium driver methods there and those are not compatible with capybara-webkit. I'm going to close this out now as the original issue is solved. Please open a new issue if you are indeed using capybara-webkit. |
How to reject js dialog window? |
Checkout this comment #84 (comment) |
I apologize if this is not the place for this but, I just upgraded to the latest capybara webkit and previous to this upgrade I was able to use this syntax for javascript confirmation boxes.
However this syntax appears that it is being deprecated.
The deprecation message says
[DEPRECATION] Capybara::Webkit::Driver#accept_js_confirms
is deprecated. Please use Capybara::Session#accept_confirm instead.
which should mean that I can swap the original code for this
but that code appears to take a block and errors when you do not have one.
What is the block used for in this case, or how should it be used?
The text was updated successfully, but these errors were encountered: