Testcomplete 的计划执行失败
对于 TestComplete 8,我们有一个脚本,计划在每天早上 06:00 通过以下行启动:
"C:\Program Files\Automated QA\TestComplete 8\Bin\TestComplete.exe" "C:\Attracs\TestComplete\Attracs\ AttracsTEST\AttracsTESTProject.mds" /r /e /SilentMode
问题是这经常失败。日志备注说: 调用“TcxCustomInnerTextEdit”对象的“Keys”方法或属性时出错。 该对象或其父对象之一不存在。
如果我使用远程桌面连接到计算机并手动运行脚本,则它可以正常工作。 没有活动的屏幕保护程序,并且电源使用方案设置为从不休眠。
我注意到 Testcomplete 需要 GUI 的句柄(屏幕可见),否则脚本会出现此类错误。难道是当它启动时它没有 GUI 组件的句柄,因为它们不可见?
来自帮助通过远程桌面运行测试:
但是,如果您最小化远程桌面窗口(显示远程计算机桌面的窗口),操作系统会将远程会话切换到 GUI- less 模式,不显示窗口和控件。因此,TestComplete(或 TestExecute)无法与测试应用程序的 GUI 交互,因为在这种情况下 GUI 实际上并不存在,并且您的自动化 GUI 测试失败。
要避免此问题,您可以在测试运行期间保持远程桌面窗口可见,但这可能会很不方便,因为它会占用部分甚至整个屏幕,并且为您运行本地应用程序留下的空间较少。
对此有什么解决方案吗?
With TestComplete 8 we have a script that is scheduled to start 06:00 every morning by this line:
"C:\Program Files\Automated QA\TestComplete 8\Bin\TestComplete.exe" "C:\Attracs\TestComplete\Attracs\AttracsTEST\AttracsTESTProject.mds" /r /e /SilentMode
The problem is that this often fails. The log remark says:
An error occurred while calling the "Keys" method or property of the "TcxCustomInnerTextEdit" object.
The object or one of its parent objects does not exist.
If I connect to the computer with Remote Desktop and manually run the script it works fine.
There is no screensaver active and the power scheme is set to never sleep.
I have noticed that Testcomplete needs a handle to GUI (the screen is visible) or the script got this kind of errors. Could it be that when it starts it have no handle to the GUI components because they aren't visible ?
From the helps Running Tests via Remote desktop:
However, if you minimize the Remote Desktop window (the window that display the remote computer’s desktop), the operating system switches the remote session to the GUI-less mode and does not display windows and controls. As a result, TestComplete (or TestExecute) is unable to interact with the tested application’s GUI, as the GUI does not actually exist in this case and your automated GUI test fails.
To avoid this issue, you can keep the Remote Desktop window visible during the test run, but this may be inconvenient as it occupies some part or even your entire screen and leaves less space for you to run your local applications.
Any solution for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有一种方法可以使 Windows 中的控制台连接始终处于活动状态,从而允许 TestComplete 无需实际连接 RDP 即可工作。
来自:在最小化的远程桌面窗口中运行测试
There is a way to enable the console connection in Windows to be active at all times, which allows TestComplete to work without actually connecting with RDP.
From: Running Tests in Minimized Remote Desktop Windows
我找到了这个页面
http://www.automatedqa.com/support/viewarticle/12567 /viewarticle.aspx?aid=12567
看来解决方案可能是在虚拟机中运行 TestComplete。
/罗兰
I found this page
http://www.automatedqa.com/support/viewarticle/12567/viewarticle.aspx?aid=12567
It seems that a solution could be that running TestComplete in a Virtual machine.
/Roland
要运行任何 UI 测试,UI 需要可用。因此,机器应该解锁,以便 TestComplete 可以执行用户操作(如鼠标单击、按键等)来工作。
但是,如果您有非 UI 测试(例如运行 Web 服务),那么它会起作用。
To run any UI test, the UI needs to be available. Hence, the machine should be unlocked so that TestComplete can perform user actions like mouse click, keys, etc to work.
However, if you have non UI test like running Web Services then it will work.
这个解决方案对我有用 -->如果您想保持桌面连接并最小化
https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/in-minimized-window.html
或者否则你可以直接断开虚拟机并尝试。它应该工作正常。只要它没有连接到任何 RD。确保您的虚拟机未连接且已最小化。
This Solution Worked for me --> In case if you want to keep desktop connected and Minimized
https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/in-minimized-window.html
Or else you can just disconnet VM and Try. It should work fine. As long as its not Connected to Any RD. Make sure your vm not connected and Minimized.