Assume I want to simulate a login in the display manager to automate a test case. More or less this would mean a tool simulating keystrokes I guess. Is there anything out there?
Options I'm aware of, but I'm not asking for:
- Disable the login completely using automatic login or password-less login
Using xnee you can do something similar, but sadly does not work fully:
- Lock your screen
- Run cnee (xnee) on a virtual console CTRL + ALT + F1 to record mouse movements and key strokes:
cnee --record --keyboard --mouse --display :0 --out-file login.xnl. This will record mouse movements and key strokes from display :0.
- Switching back to X console
- Click into the password field, enter password and press RETURN
- Switch back to virtual console to stop recording with CTRL + C
- Run cnee to replay the captured events
cnee --replay --display :0.0 --file login.xnl
- Immediately switch back to the X console (otherwise the commands will not be replayed there) You're logged in now.
What finally rendered the solution useless is that you have to switch to the X console, what would need to be automated, too.