Asked by:
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.
- Edited by Sanket.Shah.14041985 Thursday, December 26, 2013 5:59 AM
Question
All replies
-
Hi,
This is strange, it works fine on my machine(Win8.1, IE11). Every time I click, the URL is navigated, and then the DocumentComplete method will be called. Actually the event will be fired twice the first time I click the button.
There is a saying that the DocumentComplete event will not be fired when you set Visible to false, but I'm not sure if IE11 still has this problem:
BUG: DocumentComplete Does Not Fire When WebBrowser Is Not Visible
Please check if you set it to false in your original code.
And please check if the solution in this thread works:
Only DocumentComplete not fired - on some computers
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
Hi, Thanks for your reply.
But I am using win 7 enterprise, with IE 11.
Go to http://www.automationanywhere.com/Testing/ document complete message box will appear, then go to any menu items, message box would never appear.
I literally got stuck here, I tried all the options like removed old references of shdocvw and mshtml and re-added those, but it doesn't work.
-
Hi again,
I happened to have a win7 enterprise testing machine, and I upgraded IE8 to IE11 by downloading from this site: http://windows.microsoft.com/en-in/internet-explorer/ie-11-worldwide-languages, I chose English/Windows 7 SP1 64-bit version(my OS had the SP1 patch installed previously). Then I copied your code and run again. Whether I used http://stackoverflow.com/ or "http://www.automationanywhere.com/Testing/", both the raw url or any of the menu items will raise the document complete message box.
So I think there might be some problem with the installation of IE11 on you machine, I would like you to download from the official downloading site of IE11 and reinstall it. Then check if the code works for you.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
-
-
-
-
Then you could use WebBrowser control instead.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
-
Hi
I can confirm I am seeing the same problem on IE11 running on RDS 2012 R2 with IE11 - using just the normal web browser with an Enterprise Single Sign On solution that installs a BHO to the browser. We have eliminated most variables but we do have something to add:
We can see in the trace logs, the SSO solution is waiting for the DocumentComplete event to trigger even after the page load has completed. If we wait ten seconds then hit F12 or right-click in the username box and select "Inspect Element", the logs indicate DocumentComplete has triggered and it then fills in the username and password fields.
Tim Staddon
- Edited by tstaddon Monday, January 13, 2014 11:15 AM Clarification
-
-