本文介绍了WatiN UnauthorizedAccessException 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在使用 NUnit 和 WatiN 运行任何测试时收到 UnauthorizedAccessException 错误:
I am getting UnauthorizedAccessException errros when running any tests using NUnit and WatiN:
Test Test.IndexTests.Can_Do' failed: WatiN.Core.Exceptions.ElementNotFoundException : Could not find INPUT (hidden) or INPUT (password) or INPUT (text) or INPUT (textarea) or TEXTAREA element tag matching criteria: Attribute 'name' equals 'q' at http://www.google.com/ (inner exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)))
----> System.UnauthorizedAccessException : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at WatiN.Core.Element.get_NativeElement()
at WatiN.Core.Element.GetAttributeValueImpl(String attributeName)
at WatiN.Core.Component.GetAttributeValue(String attributeName)
at WatiN.Core.Element.get_Id()
at WatiN.Core.Element.get_IdOrName()
at WatiN.Core.TextField.TypeText(String value)
Class1.cs(23,0): at Tests.Can_Do()
--UnauthorizedAccessException
at mshtml.IHTMLElementCollection.tags(Object tagName)
at WatiN.Core.Native.InternetExplorer.IEElementCollection.GetElementsByTag(String tagName)
at WatiN.Core.NativeElementFinder.FindElementsByTag(String tagName)
at WatiN.Core.NativeElementFinder.<FindElementByTags>d__0.MoveNext()
at WatiN.Core.ElementFinder.FindFirst()
at WatiN.Core.Element.FindNativeElement()
at WatiN.Core.Element.get_Exists()
at WatiN.Core.Element.<>c__DisplayClass9.<WaitUntilExistsOrNot>b__8()
at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.Try[T](DoFunc`1 func)
0 passed, 1 failed, 0 skipped, took 43.44 seconds (NUnit 2.5.5).
我似乎无法通过谷歌找到任何东西,想知道是否有人遇到过类似的问题?
I can't seem to find anything via google and was wondering if anyone has had a similar problem?
干杯
推荐答案
试试我对其他问题的回答:
Try my answer to other question:
尝试关闭 IE 的保护模式或将您的站点添加到受信任区域.
这篇关于WatiN UnauthorizedAccessException 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!