Python Selenium UnexpectedAlertPresentException

前端 未结 1 1816
一向
一向 2020-12-15 20:07

I am running basic CRUD tests with python and lettuce using selenium webdriver.

All of my other tests run fine, but when I click \"Delete\", there is a modal dialog

相关标签:
1条回答
  • 2020-12-15 20:58

    You need to switch to the alert and accept it:

    world.browser.find_element_by_link_text("Delete User").click()
    alert = world.browser.switch_to.alert
    alert.accept()
    
    0 讨论(0)
提交回复
热议问题