UI Automation on session 0

698 views Asked by At

I'm trying to use UIA to automate an application. During the testing phase I run the application on remote server using psexec and starting it in session 0 since this is the only guaranteed available session.

When doing so, I'm unable to automate some of the children of the application until I switch to the session 0 desktop (from the Interactive Service Detection message).

I added some code that uses the TreeWalker to iterate over the entire tree of the application and I see that when in non-visible session 0 only some of the children are created while in interactive desktop (session 0 or other) all children are created.

Couldn't find any documentation on this issue.

Any suggestions?

1

There are 1 answers

0
Shobhit_Geek On

From windows 7 ,session 0 is not for user accounts. For getting the user session use "psexec \\[ExternalIP] -u [username] -p [password] query session" from the remote machine.After that run the psexec command in interactive mode. e.g. "psexec \\[ExternalIP] -u [username] -p password -i [sessionid] [batch/exe path]"