且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Selenium IDE处理FireFox中的安全警告弹出窗口

更新时间:2022-05-03 01:55:43

chooseOkOnNextConfirmation

不是为你工作吗?

chooseOkOnNextConfirmation()

chooseOkOnNextConfirmation()

撤消调用chooseCancelOnNextConfirmation的效果.请注意,Selenium覆盖的window.confirm()函数通常会自动返回true,就像用户手动单击确定"一样,因此除非出于某种原因,否则您不需要使用此命令在下一次确认之前改变主意.在任何之后确认后,Selenium将恢复使用默认行为以后的确认,除非/直到自动返回true(确定)您为每个显式调用selectCancelOnNextConfirmation确认.

Undo the effect of calling chooseCancelOnNextConfirmation. Note that Selenium's overridden window.confirm() function will normally automatically return true, as if the user had manually clicked OK, so you shouldn't need to use this command unless for some reason you need to change your mind prior to the next confirmation. After any confirmation, Selenium will resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each confirmation.

请注意-每次出现确认时,您都必须将其与相应的getConfirmation一起使用,否则使用下一个硒操作将失败.

Take note - every time a confirmation comes up, you must consume it with a corresponding getConfirmation, or else the next selenium operation will fail.

chooseCancelOnNextConfirmation也是一个选项

chooseCancelOnNextConfirmation is also an option