Skip to main content
4 of 4
added 853 characters in body
munro
  • 11
  • 2

Test automation in Linux: Simulate login to display manager (kdm)

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:

  1. Lock your screen
  2. 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.
  3. Switching back to X console
  4. Click into the password field, enter password and press RETURN
  5. Switch back to virtual console to stop recording with CTRL + C
  6. Run cnee to replay the captured events cnee --replay --display :0.0 --file login.xnl
  7. 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.

munro
  • 11
  • 2