testing - 如何在没有远程桌面连接的情况下在 jenkins windows slave 上运行 GUI 测试?

标签 testing user-interface jenkins continuous-integration jubula

我在 Windows 7 上设置了一个 Jenkins 代理,在 Linux 上设置了一个 Jenkins 服务器。我正在 Windows 代理上运行 GUI 测试。如果我连接了远程桌面连接,它运行良好,否则会失败。我找到了这个链接,Jenkins on Windows and GUI Tests without RDC

但那里提供的解决方案非常模糊。似乎唯一的解决方案是以某种方式让 Jenkins 服务器始终打开远程桌面连接。但是我找不到这样的选择。 谁能清楚地教我如何解决这个问题?

非常感谢!

最佳答案

Your slave machines have to be at a desktop before the test can run properly. We had the same problem.

Solution was to have the test machine start up and auto-logon to the desktop. To ensure that the test would ONLY start after the desktop was available, we added a scheduled task, set to run at user login, that would launch the Jenkins slave via Java Web Start. That way, Jenkins would only see the slave once the desktop was running. After that, everything worked fine.

这是您链接到的问题的成功答案,并且非常清楚该怎么做。整个设置在 Jenkins 之外。 Jason Swager 描述了他如何使用户自动登录到 Windows 桌面计算机,然后在用户 session 中启动 Jenkins 从服务器。

现在一步一步:

1。确保你有可用的 GUI

Solution was to have the test machine start up and auto-logon to the desktop

将标准 Windows 桌面配置为在 Windows 启动时自动登录特定用户。这样,没有人需要实际登录到桌面。 (参见 How to turn on automatic logon in Windows 7)

2。启动 Jenkins 奴隶

您需要在此用户设置中启动 Jenkins 从站。否则,Jenkins slave 将无法访问 Windows UI 组件(或者换句话说,无法与桌面交互)。

To ensure that the test would ONLY start after the desktop was available, we added a scheduled task, set to run at user login, that would launch the Jenkins slave via Java Web Start.

所以你必须create a scheduled task并将其配置为启动您的 Jenkins client using Java Web Start .

3。使用它

That way, Jenkins would only see the slave once the desktop was running. After that, everything worked fine.

当从服务器在线时,您可以使用它来运行您的 UI 测试。

关于testing - 如何在没有远程桌面连接的情况下在 jenkins windows slave 上运行 GUI 测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19441324/

相关文章:

android - 为什么在 Android Studio 3.0 中运行 kotlin 测试这么慢

testing - 自动验证我网站的链接是否指向存在的 url?

android - 静态选项菜单

java - 文件选择器只显示文件,不允许用户创建自己的文件

java - Java GUI 组件名称的语法?

git - 如何为 Jenkins (linux) 指定默认用户到 Windows slave

jenkins - 如何在 Jenkins 上构建和测试 ASP.NET Core 解决方案

linux - Jenkins 活跃(退出)

c# - 我应该只为测试目的创建新的构造函数吗?

javascript - Protractor - 使用 ng-change 时,元素在 (x,y) 点不可点击