Https://code.google.com/p/selenium/issues/detail?id=5158 reported by[email protected],Feb,
Hi,this is pavan,i would like to say thanks for providing great guidance for the people who was working on selenium like M E.issue: I am also encountering the same problem but I could not get the proper solution to resolve this issueactually Over the period of 2 months we be developing automation application using selenium Webdriver and it is running fine and We ran some cycles of regression suites,but now suddenly we is getting the following error Modal dialog present (unexpect Edalertopen) But I had Verified,there is no Model dialog box opened and also there are no IE dev tool opened but still I am Getting this issue.please find the attachment for referenceconfiguration details:ie driver 2.25.2.0windows7 (32bit) Ie8we A Re using C # with seleniumplease help me asap.
Feb,Project Member #1 barancev
Selenium automatically closes unhandled modal Diaplogs (and throws an exception). You can disable closing such diaplog your can set capability Unexpectedalertbehaviour to "ignore" (It's "dismiss" by Defau LT). In this case an exception would be thrown, but the dialog'll is not being closed and you'll be able to see IT.P.S. By the the-the-the-issue have no attachment you mentioned) P.p.s. Why does yo use 2.25? The latest version is 2.29 at the moment
Status:NeedsclarificationFeb,#2 [email protected]
Hi Can just make me understand so how to set capability Unexpectedalertbehaviour to "ignore" and one more Importnat p Onit is, this error was occuring only on the machine which have McAfee site adviser in rest of all machines scripts are Running as Expectedi did arrach the doc but no idea why do you could don't get it.again I am attaching the same here, please fi nd the same
|
Modaldialog.doc 199 KB Download |
Feb, #3 [email protected]
Namespace permedion.automation.core{#region Import namespaces using System; Using System.Configuration; Using System.IO; Using System.Xml; Using Openqa.selenium; Using OpenQA.Selenium.Chrome; Using OpenQA.Selenium.Firefox; Using OpenQA.Selenium.IE; Using OpenQA.Selenium.Remote; Using OpenQA.Selenium.UnhandledAlertException; Using OpenQA.Selenium.Safari; Using System.Windows.Automation; Using System.Threading; #endregion//<summary>//public class to implement the functionalities related to Automationbase. </summary> public class Automationbase {#region Properties//<summary>//G ETS or sets the value of the currentwebdriver of type OpenQA.Selenium.IWebDriver. </summary> public static iwebdriver currentwebdriver {get; Set } private Thread AutoThread; Declaring global variables public sTatic string Timervalue; public static int iterationcount = 1; public static string BrowserType; #endregion #region Methods//<summary>//Public method which includes logic related To Startbrowser. </summary>//<returns>returns object of type openqa.selenium.iwebdriver.</returns> p Ublic static Iwebdriver Startbrowser () {if (IterationCount <= 1) {Timervalu E = (datetime.now). ToString (). Replace (":", "."); IterationCount = IterationCount + 1; } BrowserType = ConfigurationManager.AppSettings.Get ("Browser"); Switch (Browsertype.toupper ()) {case "IE": Internetex Ploreroptions options = new Internetexploreroptions (); Options. Introduceinstabilitybyignoringprotectedmodesettings = true; Options. Ignorezoomlevel = true; Desiredcapabilities cap = Desiredcapabilities.internetexplorer (); Currentwebdriver = new Internetexplorerdriver (options); Break Case "SAFARI": Currentwebdriver = new Safaridriver (); Break Case "CHROME": Currentwebdriver = new Chromedriver (); Break Case "FF": default:firefoxprofile profile = new Firefoxprofile (); Profile. Acceptuntrustedcertificates = true; Currentwebdriver = new Firefoxdriver (profile); Break } return currentwebdriver; }Feb,#4 [email protected]
Please find the above piece of code ant make me understand where I went worng. Thanks,pavan
Feb,#5 [email protected]
As you suggested I had configured the selenium with latest drivers i.e 2.9 if still I am facing the same issue with DIFFR ENT Alert message box.i am not sure what to use capabilities with options, please help me in this since I am not able to mo ve forward.the only one diffrence I can see after installing the latest drivers are only change in alert Messgae apart from That's nothing is workedout. Internetexploreroptions options = new Internetexploreroptions (); Options. Introduceinstabilitybyignoringprotectedmodesettings = true; Options. Ignorezoomlevel = true; Desiredcapabilities iecapabilities = options. Tocapabilities () as desiredcapabilities; Iecapabilities.setcapability ("Ignore", Internetexplorerunexpectedalertbehavior.ignore); Currentwebdriver = new Internetexplorerdriver (options);
Feb,Project Member #6 [email protected]
@mailtopavan1987 with the latest. NET bindings, you should not has the use of desiredcapabilities directly in most cases. Specifically, you should is able to do the following:internetexploreroptions options = new Internetexploreroptions (); optio Ns. Introduceinstabilitybyignoringprotectedmodesettings = true;options. Ignorezoomlevel = true;options. Unexpectedalertbehavior = Internetexplorerunexpectedalertbehavior.ignore; Currentwebdriver = new Internetexplorerdriver (options); Incidentally, I would encourage you to don't use the Introduceinstabi Litybyignoringprotectedmodesettings option if at all Possible[1]. [1] http://jimevansmusic.blogspot.com/2012/08/youre-doing-it-wrong-protected-mode-and.html
Feb,#7 [email protected]
Hi,i tried with all the solutions given by if you are still I am getting the same error messgae.actually there is no opened D Ialog box to say options. Unexpectedalertbehavior = Internetexplorerunexpectedalertbehavior.ignore; But I'm wondering why still it's giving such error saying that modal dialog box present (Unhandledalertexception Unhandl Ed by user code). The Happening since we have installed mcafee-siteadviser patches before that no such error occured.is I t because of Mcafee-siteadiver? If so are there any solution to overcome this?
Feb,Project Member #8 barancev
See Also
Labels:Browser-ieFeb,Project Member #9 [email protected]
Since This behavior are only observed where McAfee SiteAdvisor are installed, I ' m calling this a duplicate of #4839.
Status:Duplicate
Labels:-status-untriaged
Mergedinto:4839
Issue 5158:modal Dialog Present (Unexpectedalertopen) Issue in IE (Similar Issue like 3360)