I am using WatiN for IE automation. I want to automate Yahoo Search (just for test). When I run WatiN.Core.Document.Eval("js code")
right after launching IE, it works and I can run my javascript on the page. However when I do some search in Yahoo and then call WatiN.Core.Document.Eval("js code")
, it throws COMException DISP_E_MEMBERNOTFOUND. Here is the method where the exception is occuring (WatiN.Core.Native.InternetExplorer.Expando.cs)
public object GetValue(string propertyName)
{
var property = AsExpando.GetProperty(propertyName, BindingFlags.Default);
if (property != null)
{
try
{
return property.GetValue(Object, null);
}
catch (COMException)
{
return null;
}
}
return null;
}
Exception details:
Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
Stack Trace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at System.Runtime.InteropServices.CustomMarshalers.ExpandoViewOfDispatchEx.DispExInvoke(String pstrMemberName, Int32 MemberDispID, Int32 Flags, Binder pBinder, Object[] aArgs, ParameterModifier[] aModifiers, CultureInfo pCultureInfo, String[] astrNamedParameters)
at System.Runtime.InteropServices.CustomMarshalers.DispatchExMethodInfo.Invoke(Object pObj, BindingFlags invokeAttr, Binder pBinder, Object[] aParameters, CultureInfo pCulture)
at System.Runtime.InteropServices.CustomMarshalers.DispatchExPropertyInfo.GetValue(Object pObj, BindingFlags invokeAttr, Binder binder, Object[] aIndex, CultureInfo culture)
at System.Reflection.PropertyInfo.GetValue(Object obj, Object[] index)
at WatiN.Core.Native.InternetExplorer.Expando.GetValue(String propertyName) in d:\AdvancedSE\Releases\SE-Dev Rel 8.3.0.0\Source\CommonPlugins\Source\CommonPlugins\SE.Core.IEAutomation\WatiN\Core\Native\InternetExplorer\Expando.cs:line 48
Please help.
User contributions licensed under CC BY-SA 3.0