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

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

问题描述

我有一个jenkins代理设置在窗口7和一个jenkins服务器在Linux上。我正在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从站。这样,
Jenkins只有在桌面运行时才会看到slave。
后,一切都很好。

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从属程序将无法访问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从站。

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只有在桌面运行时才会看到slave。
之后,一切正常。

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

当slave在线时,你可以使用它来运行UI测试。

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

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

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