UI自动化Windows用户登录

时间:2012-08-31 05:40:10

标签: python windows powershell ui-automation

我有一个测试用例,我必须在Windows UI上自动执行用户操作,

The scenario is that windows password has expired, and when user tries to login to the system, the reset password page appears and user inputs new password and login succeeds.

现在我必须通过脚本来完成这个,

好的是我在机器上运行了一个python服务,如果需要,我可以在登录前传递命令。

我搜索了很多但找不到类似的内容。

如果有人能指出我遇到的问题,我会很高兴,

这个UI自动化的参考点应该是什么?

1 个答案:

答案 0 :(得分:2)

如果您尝试自动执行Windows登录UI,我相信这是可能的,但它要求您使用Windows服务来运行测试代码。听起来你可能已经这样做了,因为你提到了一个Python服务,你可以用来运行命令而没有用户登录到Windows。

无论如何,Windows服务是我知道的唯一方法(不禁用UAC或以其他方式修改默认的Windows安全配置)。

请参阅我对这个问题的回答:

UAC and remote control

如果您的Python代码使用Windows服务的特权运行,它应该能够与系统上的任何UI交互(或者至少启动可以与安全UI交互的其他进程),包括Windows登录桌面。

唯一的问题可能是,为了与Winlogon桌面交互,您的测试代码可能需要使用CreateProcessAsUser函数启动一个单独的程序(并将“Winsta0 \ Winlogon”作为桌面参数传递)。但不确定。

这个答案看起来似乎对您的情况有帮助:

Running a process at the Windows 7 Welcome Screen

相关问题