https://code.google.com/p/selenium/issues/detail?id=5158
 
Reported by mailtopa...@gmail.com, Feb 13, 2013
Hi,
This is pavan,i would like to say thanks for providing great guidance for the people who are working on selenium like me.
Issue:
i am also encountering the same problem but i could not get the proper solution to resolve this issue Actually over the period of 2 months we are developing automation application using selenium webdriver and it is running fine and we ran some cycles of regression suites,but now suddenly we are getting the following error Modal dialog present (UnexpectedAlertOpen)but i have verified,there is no model dialog box opened and also there is no IE dev tool opened but still i am getting this issue.
please find the attachment for reference Configuration details:
IE driver 2.25.2.0
Windows7(32bit)
IE8 we are using C# with selenium Please help me asap.
Feb 13, 2013

Project Member #1 barancev

Selenium automatically closes unhandled modal diaplogs (and throws an exception). You can disable closing such diaplog you can set capability unexpectedAlertBehaviour to "ignore" (it is "dismiss" by default). In this case an exception will be thrown, but the dialog will not be closed and you'll be able to see it.

P.S. By the way, the issue has no attachment you mentioned)
P.P.S. Why do yo use 2.25 ? The latest version is 2.29 at the moment
 
 
 
Status: NeedsClarification 
 
 
 
Feb 13, 2013

#2 mailtopa...@gmail.com

Hi Can you just make me understand that how to set capability unexpectedAlertBehaviour to "ignore"

and one more importnat ponit is that this error is occuring only on the machine which has mcafee site adviser in rest of all machines scripts are running as expected

i did arrach the doc but no idea why you could not get it.

again i am attaching the same here, please find the same
Modaldialog.doc 
199 KB   Download
Feb 13, 2013

#3 mailtopa...@gmail.com

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>
/// Gets 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>
public static IWebDriver StartBrowser()
{
if (iterationCount <= 1)
{
timerValue = (DateTime.Now).ToString().Replace(":", ".");
iterationCount = iterationCount + 1;
} browserType = ConfigurationManager.AppSettings.Get("Browser");
switch (browserType.ToUpper())
{
case "IE":
InternetExplorerOptions 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 13, 2013

#4 mailtopa...@gmail.com

Please find the above piece of code ant make me understand where i went worng.

Thanks,
Pavan
Feb 14, 2013

#5 mailtopa...@gmail.com

As you suggested i had configured the selenium with latest drivers i.e 2.9 but still i am facing the same issue with diffrent alert message box.

i am not sure how to use capabilities with options, please help me in this since i am not able to move forward.

the only one diffrence i can see after installing the latest drivers is only change in alert messgae apart from that 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 14, 2013

Project Member #6 james.h....@gmail.com

@mailtopavan1987 With the latest .NET bindings, you should not have to use DesiredCapabilities directly in most cases. Specifically, you should be able to do the following:

InternetExplorerOptions options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.IgnoreZoomLevel = true;
options.UnexpectedAlertBehavior = InternetExplorerUnexpectedAlertBehavior.Ignore;
CurrentWebDriver = new InternetExplorerDriver(options); Incidentally, I would encourage you to not use the IntroduceInstabilityByIgnoringProtectedModeSettings option if at all possible[1]. [1] http://jimevansmusic.blogspot.com/2012/08/youre-doing-it-wrong-protected-mode-and.html
Feb 17, 2013

#7 mailtopa...@gmail.com

Hi,
I tried with all the solutions given by you but still i am getting the same error messgae. actually there is no opened dialog box to say options.UnexpectedAlertBehavior = InternetExplorerUnexpectedAlertBehavior.Ignore; but i am wondering why still it is giving such error saying that modal dialog box present (UnhandledAlertException unhandled by user code). this is happening since we have installed mcafee-siteadviser patch before that no such error occured. is it because of mcafee-siteadiver? if so is there any solution to overcome this?
Feb 17, 2013

Project Member #8 barancev

See also issue 4839
 
 
 
Labels: Browser-IE 
 
 
 
Feb 21, 2013

Project Member #9 james.h....@gmail.com

Since this behavior is only observed where McAfee SiteAdvisor is 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)的更多相关文章

  1. SharePoint 2010 Modal Dialog

    SharePoint 2010 Modal Dialog Tweet   Modal dialog play very important role to improve the user exper ...

  2. Create Custom Modal Dialog Windows For User Input In Oracle Forms

    An example is given below to how to create a modal dialog window in Oracle Forms for asking user inp ...

  3. iframe中的jquery ui modal dialog 覆盖父窗口

    在iframe中 使用jquery ui dialog,弹出后可以覆盖父窗体 ///iframe中的jquery ui modal dialog 覆盖父窗口 function openDialog() ...

  4. wxPython Modal Dialog 模式对话框

    <wxPython in Action>chap 9 笔记 1. Modal Dialog(模式对话框) A modal dialog blocks other widgets from ...

  5. Create Dynamic Modal Dialog Form in AdminLTE Bootstrap template

    原文地址 Create modal dialog form in jquery using bootstrap framework, slightly different from the usual ...

  6. jQuery BlockUI Plugin Demo 5(Simple Modal Dialog Example)

    Simple Modal Dialog Example This page demonstrates how to display a simple modal dialog. The button ...

  7. VUE实现Studio管理后台(完结):标签式输入、名值对输入、对话框(modal dialog)

    一周的时间,几乎每天都要工作十几个小时,敲代码+写作文,界面原型算是完成了,下一步是写内核的HTML处理引擎,纯JS实现.本次实战展示告一段落,等RXEditor下一个版本完成,再继续分享吧.剩下的功 ...

  8. 【原创】相对完美的垂直居中popup(modal/dialog),无需监听window.resize事件

    <table class="popup" style="position: absolute; background-color: black; border-ra ...

  9. jQueryUI modal dialog does not show close button (x) JQueryUI和BootStrap混用时候,右上角关闭按钮显示不出图标的解决办法

    I had this problem and was able to resolve it with the declaration below. $.fn.bootstrapBtn = $.fn.b ...

随机推荐

  1. Nginx简单配置,部分来源于网络

    nginx.conf listener监听端口 server_name监听域名 location{}是用来为匹配的 URI 进行配置,URI 即语法中的“/uri/”.location  / { }匹 ...

  2. js 技巧

    用于浮窗跳转至父窗口 parent.document.location.href='/xxx/xxx.htm'; 取父窗口的元素 window.parent.$('#xxx'); 正常跳转 windo ...

  3. OC和JS的交互---JavaScriptCore

    JavaScriptCore的简单介绍 JavaScriptCore是iOS7提供的原生框架,可以让Objective-C和JavaScript提供简单直接的交互. JavaScriptCore的使用 ...

  4. Sql Server 和 Access 数据库在书写sql语句时的语法差异

    sql:datediff(d,eff_time,getdate()) access: datediff('d',eff_time,getdate())

  5. for计算100以内的偶数和

    #include "stdio.h" void main() { ,sum=; ;d++) { ==) { sum=sum+d; } }printf("100以内所有偶数 ...

  6. JavaScript(4)——闭包与this对象以及window对象

    闭包与this对象以及window对象 这次写的是这三个内容.其实在写之前,会觉得这三个内容很多,但是写了之后会发现,内容确实很多,但是可以写出来的也并不是很多.可能是我总结能力太差.但是这些内容我觉 ...

  7. java fork-join框架应用和分析

    http://shmilyaw-hotmail-com.iteye.com/blog/1897636 java fork-join框架应用和分析 博客分类: concurrency multithre ...

  8. wps制作目录

    01 设置标题为.标题1.标题2,标题302 引用--插入目录03 配置文档结构图.查看--可快速回到目录

  9. shell:crontab

    crontab */1 * * * * (cd /home/q/system/project; /usr/bin/lockf -t 0 /tmp/discuz_bbs_audit.lock /usr/ ...

  10. 【伪一周小结(没错我一周就做了这么点微小的工作)】HDOJ-1241 Oil Deposits 初次AC粗糙版对比代码框架重构版

    2016 11月最后一周 这一周复习了一下目前大概了解的唯一算法--深度优先搜索算法(DFS).关于各种细节的处理还是极为不熟练,根据题意判断是否还原标记也无法轻松得出结论.不得不说,距离一个准ACM ...