我想将功能测试纳入我的 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
我在运行测试的输出目录中有那些。