Selenium WebDriver how to close browser popup

前端 未结 9 1061
悲&欢浪女
悲&欢浪女 2020-11-27 18:29

I am writing tests for a web App using selenium webDriver and came across a scenario where when I try to close the browser I get a popup saying \"Are you sure? The page is a

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 18:46

    Put one of these before the click event:

    selenium.chooseCancelOnNextConfirmation()
    
    selenium.chooseOkOnNextConfirmation()
    

提交回复
热议问题