Send Keyboard Input with GUI Automation

I'm using FinalBuilder6 to try and automate a task that someone performs every night which involves them connecting to a terminal server, execute a program, enter credentials and files get downloaded.

What I have done so far is:

  • I execute mstsc to connect to the terminal server
  • I click on the message box before the login box
  • I click in the field for the user name

Those things all work fine. The next step I have is to send keyboard input to type in the user name. To set this up I click on the "Click Here to find a control in a running application" to select the control where I want to type and on the keyboard input tab I have test being typed. When this step runs I get a message in the build log saying "Object reference not set to an instance of an object".

Anyone know what I might be doing wrong?

On a related note is there any way to do the GUI Automation in such a way that does not require me to select the target on every step. My vision is that I set an object variable to the target application then I can just sent keyboard input to that object.

Your help is appreciated.

What is the website you want to login?

Hi Dave

Which version of windows and terminal service client are you using. I Just tested this and it worked fine and logged me into the remote machine. This may be a timing related issue though. I had to include a pause after executing mstsc, and after clicking on the connect button I added a Wait for Window to find the user name field before attempting to provide the user name.

Having gotten past that, I hit a road block… it’s seems it’s not possible (at least with FinalBuilder) to automate windows inside a remote desktop window. The windows api calls we use to find windows and child windows does not work for remote desktops.



Saeed, it’s not a website I’m trying to login to rather it a location application on the server that does not support command line arguments.

Vincent, I am using Windows 2003 as both the target of the TS connection and from the client side of the automation. I have gotten to the point that I can login to the terminal server but like you I have run into an issue with being able to control the child window.