Watin:使用 createInNewProcess==true 启动 IE 会使 IE 超时并且不会启动测试

发布于 2024-09-30 10:27:45 字数 596 浏览 0 评论 0原文

我试图同时开发和运行 2 个测试项目(使用相同的 Web 应用程序)。当我使用 2 个 NUNIT-GUI 实例运行 2 个不同的测试时,会出现问题,因为 IE 共享会话,而 1 个测试会影响另一个测试(从应用程序中注销用户)。我发现Watin可以创建单独的IE进程,构造函数:

IE 构造函数(字符串、布尔值)
参数:
url 打开的 URL
createInNewProcess 如果设置为 true,则在新进程中创建 IE 实例。

但是,当我将 createInNewProcess 设置为 true 并启动测试时,只会打开一个空白 IE 窗口,没有输入任何站点地址,并且 NUNIT 因通信而超时:

WatiN.Core.Exceptions.IENotFoundException : 找不到匹配的 IE 窗口 约束:等待时超时 附加到新创建的实例 IE..搜索在“30”后过期 秒。

可能是什么问题?目前,作为一种解决方法,我已经开始虚拟化第二个系统。

I'm trying to develop and run 2 test projects (which use the same web application) at a time . When I run 2 different tests with 2 NUNIT-GUI instances a problem occures, because IE shares sessions and 1 test affects the other (logs out the user from the application). I found that Watin can create seperate processes of IE, constructor:

IE Constructor (String, Boolean)
Parameters:
url The URL te open
createInNewProcess if set to true the IE instance is created in a new process.

But when I set the createInNewProcess to true and launch a test just a blank IE window opens, no site address in entered and NUNIT times out with a communicate:

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.

What could be the problem? At the moment as a workaround I've started to virtualize a second system.

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

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

发布评论

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

评论(2

缱倦旧时光 2024-10-07 10:27:45

Watin 使用系统中安装的 IE,因此即使您创建较新的实例,它们也将共享相同的会话,这是由于 Internet Explorer 的默认行为。您无法使用 Watin 并行运行多个登录。

此外,当 Watin 打开的先前 IE 实例仍未关闭时,偶尔会出现 WatiN.Core.Exceptions.IENotFoundException。 Watin 尝试在下一次运行中搜索该内容并抛出此异常。

确保转到任务管理器并关闭 IE 的所有实例,然后开始测试。

Watin uses your IE installed in the system, so even if you create newer instances they all shall share the same session which is due to the default behavior of Internet Explorer. You cant run multiple logins with Watin in parallel.

Also, WatiN.Core.Exceptions.IENotFoundException comes occasionally when a previous IE instance opened by Watin remains unclosed. Watin tries to search that in next run and throws this exception.

Make sure you go to task manager and close all instances of IE and then start your tests.

与他有关 2024-10-07 10:27:45

也可能意味着您正在从服务运行它。从服务运行时我不断收到此错误消息,但从命令行运行时却没有收到此错误消息。

Also may mean that you are running this from a service. I kept getting this error message when running from a service but not when running from command line.

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