cancel
Showing results for 
Search instead for 
Did you mean: 

Reliability of Global Send Keys and Send Key Events

FelixDavid
Level 2
I'm automating a Java application and I'm using Global Send Keys to send text to the application. The text is 14 lines and it has about 180 words. While Send Keys has been working reliably for small batch of transactions (20-30), sometimes the application doesn't save text sent via Send Keys for big batch of transactions (70-80). I tried Global Send Key Events and it didn't really improve reliability. Other than restarting my application or environment, how can I improve reliability of Send Keys/Send Key Events? Thanks!
3 REPLIES 3

John__Carter
Staff
Staff
Hi Felix - try slowing things down. SK and SKE can 'machine gun' characters at the application, faster than a human can type, and maybe the app can't take input delivered at super-human speed. In v6 there is a nice 'pause between characters' field, but in earlier versions you have to chop the text into characters and have a tiny pause between each one. Another possible failure point is when the cursor is not in the field when you send the keys. Again, this is a timing thing.

BastiaanBezemer
Level 5
HI Felix, John gives very good sugestions (as always ☺) On top of this, you can after inputting the sendkeys verify if all the data is correct, e.g. by copying it to the clipboard and then compare the clipboard to your original input. (Cntrl+A, Cntrl+C) If you verify the input before submitting, you always ensure 100% reliability.

FelixDavid
Level 2
Thanks John and Bastiaan. What helped was an extension of both of your suggestions. So I cleared my clipboard, copied to clipboard and then used the application's native implementation of the Copy and Paste function by using Right Click and selecting application's paste function. This is actually more reliable than using Ctrl+A, Ctrl+C, Ctrl+V because Ctrl functions use the standard OS implementation of Copy and Paste.