【发布时间】:2012-08-03 22:58:55
【问题描述】:
我想将功能测试纳入我的 Jenkins 工作中。当我使用 nUnit 手动运行测试时,从 Jenkins 运行时一切正常:
"C:\Program Files (x86)\NUnit 2.6\bin\nunit-console.exe" /framework:net-4.0 /xml:functional-tests.xml c:\IISRoot\ALAS-QA\ALAS.Web.Test.dll /apartment=STA /process=Separate
我在每次测试中都会遇到这个异常
Test Error : ALAS.Web.Test.TestAddLead.TestAddSingleLead
WatiN.Core.Exceptions.BrowserNotFoundException : Could not find an IE window matching constraint: Timeout while waiting to attach to newly created instance of IE.. Search expired after '30' seconds.
at WatiN.Core.IE.CreateIEPartiallyInitializedInNewProcess()
at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, oolean createInNewProcess)
at FluentAutomation.WatiN.AutomationProvider.getCurrentBrowser()
at FluentAutomation.WatiN.AutomationProvider.Navigate(Uri pageUri)
at ALAS.Web.Test.TestExtensionMethods.Login(CommandManager I, String username, String password) in c:\java\jenkins\workspace\SCI-ALAS\ALAS.Web.Test\TestExtensionMethods.cs:line 40
at ALAS.Web.Test.TestAddLead.TestAddSingleLead() in c:\java\jenkins\workspace\SCI-ALAS\ALAS.Web.Test\TestAddLead.cs:line 33
出现此错误的行尝试附加到 IE 窗口。
我在 Windows 2008 服务器上,使用 IE9
2012 年 8 月 3 日星期五添加
我听说这可能是导致
- 默认情况下,对“localhost”的请求将解析为 ::1 的 IPv6 地址,而不是 127.0.0.1 的 IPv4 地址,WatiN 测试将失败。
情况并非如此,因为我正在针对不在本地计算机上的公共 URL 进行测试。
- IE 增强安全配置已开启
我已将其关闭,但没有任何结果。
-
缺少文件 Microsoft.mshtml.dll、Interop.shdocvw.dll 或 Watin.Core.dll
我在运行测试的输出目录中有这些。
【问题讨论】:
-
您是否尝试通过 URL 登录?
-
是的,我正在尝试通过 URL 附加
-
您需要找到一个补丁或注册表文件来执行此操作。
-
你能给我指点一下@Aura