org.openqa.selenium.UnhandledAlertException: unexpected alert open

后端 未结 10 753
情歌与酒
情歌与酒 2020-11-30 06:33

I am using a Chrome Driver and trying to test a webpage.

Normally it runs fine, but sometimes I get exceptions:

 org.openqa.selenium.UnhandledAlertE         


        
10条回答
  •  日久生厌
    2020-11-30 07:25

    DesiredCapabilities firefox = DesiredCapabilities.firefox();
    firefox.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.IGNORE);
    

    You can use UnexpectedAlertBehaviour.ACCEPT or UnexpectedAlertBehaviour.DISMISS

提交回复
热议问题