0
votes

My client has an ERP which has a very stupid feature, that is when ever the user is inactive for 10-15 sec it logs-out the user. And the user then has to enter the username & password again & again and it is a real headache. I have to propose a solution for this.

My idea was attach a finger print scanner and write a small service. When ever the user swipes the finger, the service, which already has a user name & password against that finger-print, it inputs the required credentials in the username & password fields and submits it.

Now idea is plain & simple. But implementation is not. The real deal is geting a focus on username & password fields(i.e text boxes).

if it would have been a web-app i would have use some browser automation library to find the required element(by id etc), but it is a desktop app and so far I don't even if it is written in native code or interpreted.

I want to know is there way by which we can write a C# code to get focus on textbox of an app and insert text in it(insert text is easy just simulate a 'paste' or a key strokes).

Or is there another possible approach on this.

1
Any chance to fix the root cause, ie ERP system? It should be a trivial config change. - oleksii
Did you contact the authors of the ERP to see what is possible to change this? - Ken White
If the ERP is a Windows forms app (or mfc) then you might be able to connect something using coded UI tests. But as other commenters have suggested fixing the probably is normally preferable to a bespoke workaround. - Squid
No sane ERP system would do this (by default) - any clue as to which ERP it is? - Charleh
It actually sounds like a configuration error. It's probably supposed to time out in 10 - 15 minutes but someone didn't realize the config value was in seconds, not minutes. - Igby Largeman

1 Answers

1
votes

Use the Spy++ shipped with Visual Studio to find the classname/hierarchy of the controls in question. You can then use Windows API commands to poke text into the controls as desired.