Sending text (username, pwd ) to a windows application

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
aqua267
Junior Coder
Posts: 27
Joined: Thu Aug 19, 2010 7:57 pm

Sending text (username, pwd ) to a windows application

Post by aqua267 » Thu Aug 19, 2010 8:05 pm

Hello,
I got started with macro scheduler yesterday, so pardon my ignorance.
I am writing a test script to launch and login a windows application. Once the login page pops up, the focus is in the username text box. I am trying to type the username, hit tab and then type password and then Hit Alt +L (for logging in).

I am able to launch the application, however I can not make it type the username in the textbox.
I have tried Send, Send Character.

Please help.
TIA.

aqua267
Junior Coder
Posts: 27
Joined: Thu Aug 19, 2010 7:57 pm

Post by aqua267 » Thu Aug 19, 2010 8:16 pm

I also tried SendText, but that did not work either.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Thu Aug 19, 2010 8:25 pm

The particular form (window) which is to receive the typed text needs to have the focus first before you do a Send>.

Do a SetFocus> command then a small wait i.e. Wait>0.5 then do the Send> to type in the field.

Example:

Code: Select all

WaitWindowOpen>Login
Wait>0.5
SetFocus>Login
Wait>0.5
Send>mylogin
Wait>0.5
Press Tab
Wait>0.5
Send>mypassword
Wait>0.5
Press Alt
Send>l
Release Alt
Note that the last Send>l is sending a lowercase "L" not a 1

aqua267
Junior Coder
Posts: 27
Joined: Thu Aug 19, 2010 7:57 pm

Post by aqua267 » Thu Aug 19, 2010 8:37 pm

SetFocus did the trick. When the login window popped up, the cursor was at the username textbox field. So I assumed focus was already there.
I appreciate your instant reply.Thanks very much.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts