Issue 5158: Modal dialog present (UnexpectedAlertOpen) issue in IE (Similar issue like 3360)
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.
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
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 |
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;
}
Please find the above piece of code ant make me understand where i went worng. Thanks,
Pavan
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);
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
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?
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.
Labels: -Status-Untriaged
Mergedinto: 4839
Issue 5158: Modal dialog present (UnexpectedAlertOpen) issue in IE (Similar issue like 3360)的更多相关文章
- SharePoint 2010 Modal Dialog
SharePoint 2010 Modal Dialog Tweet Modal dialog play very important role to improve the user exper ...
- 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 ...
- iframe中的jquery ui modal dialog 覆盖父窗口
在iframe中 使用jquery ui dialog,弹出后可以覆盖父窗体 ///iframe中的jquery ui modal dialog 覆盖父窗口 function openDialog() ...
- wxPython Modal Dialog 模式对话框
<wxPython in Action>chap 9 笔记 1. Modal Dialog(模式对话框) A modal dialog blocks other widgets from ...
- Create Dynamic Modal Dialog Form in AdminLTE Bootstrap template
原文地址 Create modal dialog form in jquery using bootstrap framework, slightly different from the usual ...
- 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 ...
- VUE实现Studio管理后台(完结):标签式输入、名值对输入、对话框(modal dialog)
一周的时间,几乎每天都要工作十几个小时,敲代码+写作文,界面原型算是完成了,下一步是写内核的HTML处理引擎,纯JS实现.本次实战展示告一段落,等RXEditor下一个版本完成,再继续分享吧.剩下的功 ...
- 【原创】相对完美的垂直居中popup(modal/dialog),无需监听window.resize事件
<table class="popup" style="position: absolute; background-color: black; border-ra ...
- 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 ...
随机推荐
- redis数据类型:sets
sets类型及操作: set是集合,它是string类型的无序集合.set是通过hash table实现的, 添加.删除和查找的复杂度都是O(1).对集合我们可以取并集.交集.差集. 通过这些操作我们 ...
- javacript参数传递表单验证
<!doctype html> <html> <head> <meta charset="utf-8"> <style typ ...
- ADO.NET 完整修改、删除、防字符串攻击
首先,我先把昨天所做的人事管理系统进行了优化,将其完善成为了一个更符合实际的系统.将修改及删除数据的数据库操作前面添加了一个查询语句,这样,在实际操作时,如果数据库中没有该条数据,则程序不会执行接下来 ...
- python基础(三)--列表、元组、字典
一.列表: 有序序列,支持索引.切片.循环(for,while) 元素可以被修改: 元素可以是任何数据类型(数字,字符串,列表,布尔值...),可以嵌套: ##增 1.append(object) ...
- 1.0 Python 学习网站
w3cschool : http://www.runoob.com/python/python-tutorial.html cnblog Python 从入门到精通: http://www.cnbl ...
- iOS学习笔记(01) - 泛型
决定新开一坑,在不断学习的同时分享自己的学习历程给大家,既是对自己学习的记录,又希望能对大家提供些微的帮助. 这一篇文章主要来介绍泛型的意义.使用与声明方法等. 1.泛型:限制类型 1.1.泛型使用场 ...
- 1-10w之间的整数中有几个完全平方数
#include "stdio.h" #include<math.h> void main() { ,x,y; printf("1-10w之间的整数中有以下几 ...
- VBS实现批量重命名文件并且操作前备份原有文件
'=========================================================================='' VBScript Source File - ...
- VBS基础篇 - 循环语句(4) - For Each...Next
VBS基础篇 - 循环语句(4) - For Each...Next For Each...Next 循环与 For...Next 循环类似.For Each...Next 不是将语句运行指定的次 ...
- MFC中实现定时执行与提醒功能(自编代码)
具体实现代码如下:添加一个计时器:SetTimer(1,1000,NULL); 下面仅列举核心代码,详细步聚不作说明,效果如下所示: void CShowTimer::OnTimer(UINT_PTR ...
