Javascript 找不到成员。(HRESULT的异常:0x80020003(DISP_E_MEMBERNOTFOUND))

Javascript 找不到成员。(HRESULT的异常:0x80020003(DISP_E_MEMBERNOTFOUND)),javascript,watin,comexception,Javascript,Watin,Comexception,我正在使用WatiN实现IE自动化。我想自动化雅虎搜索(只是为了测试)。当我在启动IE后立即运行WatiN.Core.Document.Eval(“js代码”)时,它可以工作,我可以在页面上运行javascript。然而,当我在Yahoo中进行一些搜索,然后调用WatiN.Core.Document.Eval(“jscode”),它会抛出COMException DISP_E_MEMBERNOTFOUND。下面是发生异常的方法(WatiN.Core.Native.InternetExplorer

我正在使用WatiN实现IE自动化。我想自动化雅虎搜索(只是为了测试)。当我在启动IE后立即运行
WatiN.Core.Document.Eval(“js代码”)
时,它可以工作,我可以在页面上运行javascript。然而,当我在Yahoo中进行一些搜索,然后调用
WatiN.Core.Document.Eval(“jscode”)
,它会抛出COMException DISP_E_MEMBERNOTFOUND。下面是发生异常的方法(WatiN.Core.Native.InternetExplorer.Expando.cs)

例外情况详情:

Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
堆栈跟踪:

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

请帮忙

您是否尝试在DOM完全加载后评估脚本?是的,但没有帮助。还有其他想法吗?在加载页面和运行代码之前,您是否遇到任何类型的错误?(使用Chrome中的CTRL+SHIFT+I或IE中的F12进行检查)唉!没有运行时JS错误。
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