如何在没有远程桌面连接的情况下在 jenkins windows slave 上运行 GUI 测试? [英] How to run GUI tests on a jenkins windows slave without remote desktop connection?

查看:31
本文介绍了如何在没有远程桌面连接的情况下在 jenkins windows slave 上运行 GUI 测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在窗口 7 上设置了 jenkins 代理,在 Linux 上设置了 jenkins 服务器.我正在 Windows 代理上运行 GUI 测试.如果我连接了远程桌面连接,它运行良好,否则会失败.我找到了这个链接,Windows 上的 Jenkins 和没有 RDC 的 GUI 测试

I have a jenkins agent set up on window 7 and a jenkins server on Linux. I am running GUI testing on the windows agent. It runs fine if I have a remote desktop connection connected to it, but fails otherwise. I found this link, Jenkins on Windows and GUI Tests without RDC

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

But the solution provided there is pretty vague.. It seems like the only solution is to somehow make Jenkins server to have a remote desktop connection open at all times. But I can't find such an option to do so. Could anyone please clearly teach me how to solve this issue?

非常感谢!

推荐答案

您的从机必须在桌面上才能运行测试适当地.我们遇到了同样的问题.

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

解决方案是让测试机启动并自动登录到桌面.确保测试只会在桌面之后开始可用,我们添加了一个计划任务,设置为在用户登录时运行,这将通过 Java Web Start 启动 Jenkins slave.那样,Jenkins 只会在桌面运行后才能看到从站.后一切正常.

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 台式机,然后在用户会话中启动 Jenkins 从站.

This is the winning answer to the question you linked to and it is very clear on what to do. The whole setup is outside of Jenkins. Jason Swager discribed on how he automated a user logging into a windows desktop machine and then starting the Jenkins slave in the user session.

解决方案是让测试机启动并自动登录到桌面

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

配置标准 Windows 桌面以在 Windows 启动时自动登录特定用户.这样,没有人需要实际登录桌面.(参见 如何在 Windows 7 中开启自动登录)

Configure a standard Windows desktop to login a specific user automatically when windows start. This way nobody needs to physically log into the desktop. (see How to turn on automatic logon in Windows 7)

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

You need to start the Jenkins slave within this user setting. Otherwise, the Jenkins slave won't have access to the Windows UI components (or in other words can not interact with the desktop).

为了确保测试只会在桌面之后开始可用,我们添加了一个计划任务,设置为在用户登录时运行,这将通过 Java Web Start 启动 Jenkins slave.

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.

所以你必须创建计划任务并配置它使用 Java Web Start 启动您的 Jenkins 客户端.

So you have to create a scheduled task and configure it to start your Jenkins client using Java Web Start.

这样,Jenkins 只会在桌面运行时看到从属设备.后一切正常.

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

当从站在线时,您可以使用它来运行您的 UI 测试.

When the slave is online, you can use it to run your UI tests.

这篇关于如何在没有远程桌面连接的情况下在 jenkins windows slave 上运行 GUI 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆