How to simulate keyboard input to a console application?
I have developed an application in bash that uses "whiptail" to display dialogs in a terminal. (I personnally don't like this kind of UI but i'm only a developer, i don't make decisions ...). Anyway, now i have to test it, and i would like to simulate a user that types values, press "Enter", "Echap", "Tab", "down arrow", "up arrow"
I didn't get expect working and it seems it is not possible (http://oldsite.debianhelp.org/node/11812). There is no X on the machine, so xdotool cannot be used. So, how can i test this kind of dialogs ? Is it possible to write to the process stdin and "make it believe" it receive input from the tty ? Or maybe by writing to a specific device in /dev ? Thanks |
This may sound silly, but you could ssh in and automate the testing on the client machine.
|
Yes, it's a good idea !
anyway, someone found the solution on stackoverflow: http://stackoverflow.com/questions/7...370822#7370822 |
All times are GMT -5. The time now is 07:34 PM. |