Monday, December 30, 2013

Document Complete Event Is not Raising in Internet explorer 11


using System;
using System.Windows.Forms;
using SHDocVw;

namespace IE11_POC
{
public partial class Form1 : Form
{
InternetExplorer IE;

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

IE = new InternetExplorer();
IE.Visible = true;

IE.DocumentComplete += IE_DocumentComplete;
IE.Navigate("http://stackoverflow.com/");

}


void IE_DocumentComplete(object pDisp, ref object URL)
{
MessageBox.Show(URL.ToString());
}

}
}



Got one very weird scenario on Internet explorer 11. I have written one C# automated program for Internet explorer which was working fine till IE 10, now suddenly from IE 11, document complete stopped to raise more them 8 out of 10 times.


Just take an example of above code.


it will show Message box for the first time then it will never show that.



No comments:

Post a Comment