2012-08-02 271 views
0

我想将功能测试融入到Jenkins的工作中。当我和NUnit的一切工作就好了手动运行测试时,我从詹金斯运行:Watin在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

    我有那些在我的输出目录中的测试运行。

+0

您是否正在尝试通过URL登录? – 2012-08-03 10:39:57

+0

是的,我正在尝试附加URL – lstanczyk 2012-08-03 14:00:37

+0

你需要找到一个补丁或注册表文件来做到这一点。 – 2012-08-06 06:39:53

回答

0

我从这个试图信息,以便张贴Watin through tfs on windows 2008 server 这基本上说,

自动化UI测试不能运行为Windows服务的生成代理上运行,因为它不是交互式的,也就是说,它不能与桌面

,所以我对具有在詹金斯NUnit的呼叫并运行它喜欢巴赫的文件创建我自己的“互动式代理”规划互动:

cmd /interactive /c C:\workfolder\nunit-test.bat 
+0

而且没有骰子 - 这不起作用 – lstanczyk 2012-08-03 15:25:33