How to handle the “unexpected alert open”?

后端 未结 7 568
耶瑟儿~
耶瑟儿~ 2020-12-28 18:07

I got an issue with Selenium throwing timeout exception because of a pop up window

  unexpected alert open
  not provide any stacktrace inform         


        
7条回答
  •  忘掉有多难
    2020-12-28 18:35

    ChromeOptions options = new ChromeOptions();
    options.setUnhandledPromptBehaviour(ACCEPT);
    WebDriver driver = new ChromeDriver(options);
    

    Instead of ACCEPT you can pass the following enum constants ACCEPT, ACCEPT_AND_NOTIFY, DISMISS, DISMISS_AND_NOTIFY, IGNORE according to your requirement.

提交回复
热议问题