UI 自动化 Windows 用户登录 [英] UI Automation Windows User login

查看:89
本文介绍了UI 自动化 Windows 用户登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a test case where i have to automate user action on windows UI,

场景是windows密码已过期,当用户尝试登录系统,出现重置密码页面,用户输入新密码,登录成功.

现在我必须通过脚本来做到这一点,

Now i have to do this through a script,

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

Good thing is i have a python service running on the machine to which i can pass commands if required prior to login.

我在谷歌上搜索了很多,但找不到类似的东西.

I have Googled a lot but could not find anything similar.

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

Would be very glad if anyone can point me to anything specific to my problem,

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

What should be my reference point for this UI automation??

推荐答案

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

If you're trying to automate the Windows logon UI, I believe it's possible, but it requires that you use a Windows service to run your test code. Sounds like you may already be doing that, since you mentioned a Python service you can use to run commands while no user is logged in to Windows.

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

Anyway, Windows services are the only way I know to do this (without disabling UAC or otherwise modifying the default Windows security configuration).

请参阅我对这个问题的回答以获得一些提示:

See my answer to this question for some pointers:

UAC 和远程控制

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

If your Python code is running with the privileges of a Windows service, it should be able to interact with any UI on the system (or at least launch other processes that can interact with secure UI), including the Windows logon desktop.

唯一令人头疼的可能是为了与 Winlogon 桌面交互,您的测试代码可能需要使用 CreateProcessAsUser 函数启动一个单独的程序(并传递Winsta0\Winlogon"作为桌面参数).不过不确定.

The only headache may be that in order to interact with the Winlogon desktop, your test code may need to launch a separate program with the CreateProcessAsUser function (and pass "Winsta0\Winlogon" as the desktop param). Not sure, though.

这个答案看起来也可能对您的情况有所帮助:

This answer also looks like it might be helpful in your situation:

在 Windows 7 欢迎屏幕上运行进程

这篇关于UI 自动化 Windows 用户登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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