Code: Select all
public static void WaitIECtrl()
{
while (IE.Busy && IE.Visible)
{
System.Threading.Thread.Sleep(500);
}
WriteToReportType("Info", "Waited for Internet Explorer Control...");
}
Unexpected exception occured: System.Runtime.InteropServices.COMException (0x800706B5): The interface is unknown. (Exception from HRESULT: 0x800706B5)
at SHDocVw.InternetExplorerClass.get_LocationURL()
at StartIE() in Code.cs:line 285
It says that it bombs at line 85 which is this code:
urlStr = IE.LocationURL.ToString();
From this code block:
Code: Select all
public static bool StartIE()
{
object misValue = new object();
string[] logStatusStr = {"Successful", "Failed"};
string logOnPortalStr = string.Format(PortalLogInURL.ToString(), StackPortal.ToString());
string urlStr = string.Empty;
string logStr = "IE Status: ";
bool rtnStatus = false;
try
{
IE = new SHDocVw.InternetExplorerClass();
IE.Navigate(logOnPortalStr, ref misValue, ref misValue, ref misValue, ref misValue);
IE.Visible = true;
while (IE.Busy)
{
System.Threading.Thread.Sleep(500);
}
Ranorex.Delay.Seconds(1);
urlStr = IE.LocationURL.ToString();
if (urlStr == logOnPortalStr)
{
logStr += logStatusStr[0];
rtnStatus = true;
}
else
{
logStr += logStatusStr[1];
}
WriteToReportType("Info", logStr);
return rtnStatus;
}
catch (Exception e)
{
WriteToReportType("Failure", "Unexpected exception occured: " + e.ToString());
return false;
}
}