How to handle an Alert with “UnexpectedAlertBehaviour” capability in Selenium?

后端 未结 4 533
北荒
北荒 2020-12-04 02:37

In selenium framework 2.25, I see that we have the UnexpectedAlertBehaviour enum type, but I don\'t know how to use it.

4条回答
  •  醉梦人生
    2020-12-04 03:02

    Try to do like this:

    DesiredCapabilities ff = DesiredCapabilities.firefox();
    ff.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR  UnexpectedAlertBehaviour.ACCEPT);
    

提交回复
热议问题