如何运行White + Teamcity(Winforms应用程序) [英] How to run White + Teamcity (Winforms application)

查看:187
本文介绍了如何运行White + Teamcity(Winforms应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行UI测试(使用白色书写)。当我使用NUnitConsole运行它们一切工作正常。当我尝试使用TeamCity运行它们时,我得到以下异常 Test(s)失败。 White.Core.UIItems.UIActionException:在等待5000 ms后,在进程4132中找不到标题为Form1的窗口。什么可能是错误?我能做什么让测试通过?

I'm trying to run UI-tests (written using white). When I run them using NUnitConsole everything works fine. When I try to run them using TeamCity I get the following exception Test(s) failed. White.Core.UIItems.UIActionException : Couldn't find window with title Form1 in process 4132, after waiting for 5000 ms. What might be wrong? What could I do to make the test pass?

推荐答案

构建代理不仅需要设置为与桌面交互, UI自动化工作 - 桌面无法锁定,屏幕保护程序不能运行。你的代理在无头机器上吗?如果您使用RDP连接到代理以检查事情,当您关闭RDP时,它会锁定桌面。在这种情况下,自动化将失败。

Not only does the build agent need to be set to interact with the desktop, but the desktop must be displayed in order for UI automation to work - desktop cannot be locked and screen saver must not be running. Is your agent on a headless machine? If you are using RDP to connect to the agent to check on things, when you close RDP, it locks the desktop. In this case, the automation will fail. Instead of using RDP, use a VNC viewer to log on to the box, rather than RDP, as VNC will not lock the desktop when you close it.

另一个问题是,如果没有使用RDP,VNC浏览器不能使用RDP,而是使用VNC查看器登录到框,而不是RDP。考虑是网络接入。如果您正在运行TC代理作为一个服务,有权访问桌面,那么它将在服务帐户下运行,无法访问网络共享等等。如果这是一个问题,那么您将无法运行TC代理作为服务,而需要登录域用户并启动agent.bat文件以启动代理。

Another issue to consider is network access. If you are running TC agent as a service with access to desktop, then it will be running under service account which will not have access to network shares, etc... If this is a probelm, then you will not be able to run TC agent as a service, and will instead need to logon with a domain user and kick off the agent.bat file to start the agent.

这篇关于如何运行White + Teamcity(Winforms应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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