如果远程桌面窗口没有焦点,则播放将失败 [英] Playback fails if the remote desktop window doesn't have focus
问题描述
我有一个带登录屏幕的简单C#应用程序,使用CodedUI Test自动化。它工作正常如下
I have a simple C# App with Login Screen, automationed using CodedUI Test. It works fine as below
1。 TS到远程机器。
1. TS to Remote Machine.
2。在远程测试机器上复制DLL
2. Copy the DLL on a remote test machine
3。运行测试,如"D:\Program Files \ Microsoft Visual Studio 10.0 \ Common7 \IDE \\\ testtest.exe" /testcontainer:codedUITest.dll"
3. running the test like "D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:codedUITest.dll"
,同时专注于远程机器。
while having focus on the Remote Machine.
现在,如果,在运行上述命令之后,如果我切换回我的主机,然后远程机器上的测试运行停止。它不会填充用户名和密码的编辑框。
Now if, just after running the above command, If I switch back to my Host Machine, then the test run on the remote machine stalls. It doesn't populate the Edit boxes for User Name and Password.
如果我使用ALT + TAB在主机和远程机器之间切换,我可以看到一些测试进展,但它可能发生的那个 密码不会完全写入编辑框。
If I switch between Host and Remote machine using ALT+TAB, I can see that some the test progresses, but it may happen that the Password doesn't get written fully to the edit box.
我想在不同的机器上针对同一台服务器运行此登录方案。但是我看到,如果远程计算机没有焦点,则测试不会继续。
I wanted to run this login scenario on different machine against same server. But I see that, if the Remote machine doesn't have focus, test doesn't proceed.
这是我在代码中的内容。
Here is what I have in the code.
//在'用户名'中选择'avondale@msn-int.com'
组合框
uIUserNameComboBox.EditableItem = _tc.DataRow [
uIUserNameComboBox.EditableItem = _tc.DataRow[
" UserName" ]。ToString();
"UserName"].ToString();
//在"用户名"文本框中输入"{Tab}"
键盘 。SendKeys(uIUserNameEdit,
this 。LoginAndCreateSRParams_map.UIUserNameEditSendKeys,
ModifierKeys 。无);
Keyboard.SendKeys(uIUserNameEdit, this.LoginAndCreateSRParams_map.UIUserNameEditSendKeys, ModifierKeys.None);
//在'm_passwordBox'文本框中输入'********'
// Type '********' in 'm_passwordBox' text box
键盘 。SendKeys(uIM_passwordBoxEdit,
_tc.DataRow [ "密码" ]。ToString(),
false );
Keyboard.SendKeys(uIM_passwordBoxEdit, _tc.DataRow["Password"].ToString(), false);
键盘 。SendKeys
(uIM_passwordBoxEdit, " {ENTER}" ,
false );
Keyboard.SendKeys (uIM_passwordBoxEdit, "{ENTER}", false);
我只在远程计算机上安装了代理。
请建议我如何解决这个问题。
谢谢和问候
Vikas Singh
推荐答案
你必须让你的RDP for Coded UI Test的活动会话成为如果你的RDP会话最小化(焦点改变了),那么UI测试将不会运行。我建议你在VM会话上运行你不会遇到这个问题。
You have to have the active session of your RDP for Coded UI Test to be running fine. UI tests will not be run if you have a RDP session minimized (focus changed). I would suggest you to do the run on VM sessions there you'll not face this issue.
这篇关于如果远程桌面窗口没有焦点,则播放将失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!