简体   繁体   中英

UI Automation Windows User login

I have a test case where i have to automate user action on 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.

Now i have to do this through a script,

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,

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

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.

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 and remote control

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.

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:

Running a process at the Windows 7 Welcome Screen

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM