问题
I am using Selenium IDE 2.5.0.
When used Firefox 23.0.1, it displays "Security Warning" popup window with "Continue" and "Cancel" option. Once this popup window displays it does not allow to select anything or view source file before clicking either "Continue" and "Cancel"
I tried all the mentioned solutions like, about:config but there is no security.warn in the list mentioned.
I also tried to disable all warnings in security tab/settings button(warning messages)
Some one suggested the emulate the 'Enter' key but I could not get the option on how to view pop-up window name as I can't view the source files.
Can you help on how to work around on this?
I am struggeling for more than two weeks with this.
Thank you for your suggestions
Amit
回答1:
At first I would try to get rid of the message. There seams to be a misconfiguration and the browser tries to warn the user.
2) I didn't have the exact message same till now, but closing of alerts work like this:
executeScript("window.alert.myAlertText = null;");
executeScript("window.confirm = function(msg){ window.alert.myAlertText = msg; return true; };");
Where executeScript just uses the driver as JavascriptExecuter. This source has to be called before a confirm dialog can happen. It closes any confirm dialog immediately and stores the text for later use.
回答2:
chooseOkOnNextConfirmation
Didn't work for you?
chooseOkOnNextConfirmation()
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.
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 is also an option
来源:https://stackoverflow.com/questions/24320118/handle-securtiy-warning-pop-up-in-firefox-with-selenium-ide