【问题标题】:Watin tests failing in JenkinsWatin 测试在 Jenkins 中失败
【发布时间】: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

标签: nunit jenkins watin


【解决方案1】:

我正在尝试来自此 SO 帖子 Watin through tfs on windows 2008 server 的信息 这基本上说明了

自动化 UI 测试不能在作为 Windows 服务运行的构建代理中运行,因为它不是交互式的,这意味着它不能与桌面交互

所以我计划通过拥有一个包含 nunit 调用的 bach 文件并在 Jenkins 中像这样运行它来创建我自己的“交互式代理”:

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

【讨论】:

    猜你喜欢
    • 2011-09-16
    • 2020-01-01
    • 2016-01-04
    • 1970-01-01
    • 2010-09-16
    • 2016-05-23
    • 2017-03-20
    • 2017-05-21
    • 2019-03-09
    相关资源
    最近更新 更多