Rspec + Capybara : How to click on alert box

后端 未结 6 1254
梦谈多话
梦谈多话 2020-12-29 19:15

I have gone through the post of capybara + click on alert box but nothing seems to be work. Following is my scenario:

Scenario: When I click update

6条回答
  •  一整个雨季
    2020-12-29 19:39

    For WebKit:

    page.accept_confirm { click_button "Upgrade" }
    

    For Selenium:

    page.driver.browser.switch_to.alert.accept
    

提交回复
热议问题