简体   繁体   中英

Is it possible to run UI Automation as a Windows service?

I have a Windows VM with a desktop application on it. I want to write an agent which will interact with this application through UI automation (via WinAppDriver ). The agent should start with the machine and require as little human intervention as possible to do its job.

It's easy enough to get this working by adding it to startup programs (shell:startup), but this requires someone logging into the VM every time it is restarted. Is it possible to run such a program as a Windows Service? Keep in mind it would have to launch a Win32 app and interact with it via UI automation. Could this be done by running it as Local System account and enabling "Allow service to interact with desktop"? Or would it need to run as a specific user account?

No, it is because Windows Service runs in background and to access the UI the process should run foreground.

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