在 Windows 2008 Server 上通过 TFS 进行 WatiN

发布于 2024-08-09 21:35:46 字数 1211 浏览 2 评论 0 原文

我正在尝试通过 TFS 上的持续构建来运行 WatiN 测试,但我无法让它工作。我收到的错误如下:

WatiN.Core.Exceptions.IENotFoundException : 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, Boolean createInNewProcess)
     at WatiN.Core.IE..ctor(String url, Boolean createInNewProcess)

我读到这可能是

  • “localhost”请求将解决的 原因 默认为 ::1 的 IPv6 地址 而不是 IPv4 地址 127.0.0.1 并且 WatiN 测试将失败。

情况并非如此,因为我正在针对不在本地计算机上的公共 URL 进行测试。

  • IE 增强安全配置已打开

我已将其关闭但没有任何结果。

  • 缺少文件 Microsoft.mshtml.dll、Interop.shdocvw.dll 或 Watin.Core.dll

检查并仔细检查!我将它们放在运行测试的输出目录中。

最后一次测试是以运行构建的用户身份登录并执行 NUnit 测试套件并手动运行测试。

C:\Users\TFSSERVICE>"C:\Program Files\Nunit 2.5.2\bin\net-2.0\nunit-console.exe"
 /nologo C:\Users\BUILDSERVICE\AppData\Local\Temp\\Continuous\Binaries\Release
\\WebTests.dll

你猜怎么着!它可以作为 tfs 构建用户手动执行它们。那么,我在这里缺少什么?你知道为什么当我运行 msbuild 引擎时它总是超时吗?

任何想法都欢迎! 米凯尔

I'm trying to run WatiN tests through continuous build on TFS, but I can't get it to work. The errror I get is following:

WatiN.Core.Exceptions.IENotFoundException : 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, Boolean createInNewProcess)
     at WatiN.Core.IE..ctor(String url, Boolean createInNewProcess)

I've read that this may be the cause of

  • Requests for "localhost" will resolve
    to the IPv6 address of ::1 by default
    rather than the IPv4 address of
    127.0.0.1 and the WatiN tests will fail.

This is not the case, because I'm testing against a public URL not on the local machine.

  • IE Enhanced Security Configuration turned on

I've turned this off without any result.

  • Missing files Microsoft.mshtml.dll, Interop.shdocvw.dll or Watin.Core.dll

Check and double check! I have those in my output directory where the tests are run.

The last and final test was to login as the user that runs the build and executes the NUnit testing suite and run the tests by hand.

C:\Users\TFSSERVICE>"C:\Program Files\Nunit 2.5.2\bin\net-2.0\nunit-console.exe"
 /nologo C:\Users\BUILDSERVICE\AppData\Local\Temp\\Continuous\Binaries\Release
\\WebTests.dll

Guess what! It works executing them manually as the tfs build user. So, what am I missing here? Have any ideas why it just keeps timing out when I run through the msbuild engine?

Any thought are welcome!
Mikael

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

过度放纵 2024-08-16 21:35:46

从错误来看,它正在寻找 Intenet Explorer 窗口。如果构建过程正在由服务运行,它将无法找到。

编辑:之前我说过我不知道如何解决这个问题。
虽然我不这样做,页面可以。查找标题为“自动化 UI 测试”的部分。这应该也适用于 WatiN。

Judging by the error, it is looking for an Intenet Explorer window. Which it won't be able to find if the build process is being run by a service.

EDIT: Previously I said I didn't know how to fix this.
Although I don't, this page does. Look for the section titled "Automated UI Tests". This ought to work for WatiN as well.

请叫√我孤独 2024-08-16 21:35:46

经过调试Watin,我找到了这个问题的原因。
原因是错过了dll:Microsoft.mshtml.dll。

Windows Server 2008 主板上没有此文件,因此会出现此类错误。

解决方案:
- 从 Windows 7 中获取 Microsoft.mshtml.dll;
- 复制到应用程序根目录。

I have found the reason of this issue after debugging Watin.
The reason is missed dll : Microsoft.mshtml.dll.

Windows Server 2008 does not have this file on the board so such error raises.

Solution:
- take Microsoft.mshtml.dll from Windows 7;
- copy to the application root directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文