Windows 上的 Jenkins 和没有 RDC 的 GUI 测试 [英] Jenkins on Windows and GUI Tests without RDC

查看:27
本文介绍了Windows 上的 Jenkins 和没有 RDC 的 GUI 测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有 Jenkins 的主从配置.我们的 .NET 项目是由运行在 Windows 上的从属 Jenkins 实例构建的.

We have a master-slave configuration for Jenkins. Our .NET project is built by a slave Jenkins instance running on Windows.

有很多 GUI 测试,但它们似乎只有在远程桌面连接 (RDC) 会话打开时才能运行.

There are a bunch of GUI tests, however they only seem to run if there's a remote desktop connection (RDC) session open.

尝试在没有 RDC 的情况下运行测试时,Jenkins 没有显示任何测试进度.然后,我连接到Slave的桌面,可以看到启动的应用程序的主窗口,但是UI测试框架(白色)不能执行任何操作.

When trying to run the tests with no RDC, Jenkins doesn't show any progress in testing. Then, however, I connect to the Slave's desktop and can see the main window of the application launched, however the UI testing framework (White) cannot perform any actions.

Jenkins slave 通过 Java Web Start 启动.

The Jenkins slave is launched via Java Web Start.

我在几个网站上读到,很遗憾,没有 RDC 会话就无法运行 GUI 测试.

I read on several websites that unfortunately it is not possible to run GUI tests without RDC session.

我只是想确认这是真的,想知道是否有任何解决方法.

I just want to confirm that it is true and wonder if there is any workaround.

推荐答案

在测试可以正常运行之前,您的从属计算机必须在桌面上.我们遇到了同样的问题.

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

解决方案是让测试机启动并自动登录到桌面.为确保测试仅在桌面可用后开始,我们添加了一个计划任务,设置为在用户登录时运行,它将通过 Java Web Start 启动 Jenkins 从站.这样,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.

这篇关于Windows 上的 Jenkins 和没有 RDC 的 GUI 测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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