Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡Use an Auto Typer to help test your GUI #247

Open
Ryuse opened this issue Feb 20, 2025 · 2 comments
Open

💡Use an Auto Typer to help test your GUI #247

Ryuse opened this issue Feb 20, 2025 · 2 comments

Comments

@Ryuse
Copy link

Ryuse commented Feb 20, 2025

Write your test cases in an Auto Typer to test your program and just let it run. Here's how it looks in action.

java_Z2X7UZIutC.mp4

I use Auto Typer by MurGee.com

Image

This is how it looks when set up

Image

So why not set up yours now?
Happy testing!

@damithc
Copy link
Contributor

damithc commented Feb 20, 2025

Nice! Thanks @Ryuse for sharing.
Looks like this one is Windows only. Let's see if others can find similar tools for Mac/Linux.

@zuoshihua
Copy link

zuoshihua commented Feb 21, 2025

For Mac/Linux users, check out xdotool

Installation guide from the README copied below 👇

You may find xdotool in your distribution packaging:

  • Debian and Ubuntu: apt-get install xdotool
  • Fedora: dnf install xdotool
  • FreeBSD: pkg install xdotool
  • macOS: brew install xdotool or sudo port install xdotool
  • OpenSUSE: zypper install xdotool

Note

For Linux users, this tool only works with X11 sessions. Ensure you have X11 session installed for your desktop environment. If you're on Wayland, logout then login with X11.

Here's a script to automate the process

xdotool search --name "$1" windowactivate
xdotool key "KP_Tab"

while read -r LINE
do
  xdotool type "$LINE"
  xdotool key "KP_Enter"
done < "$2"

To use it, copy the above to a file auto.sh

Next, create a file (in the same directory) with all your commands separated by newlines e.g.

help
list

Name this text file commands.txt

Run the script like this ./auto.sh [title] commands.txt where title refers to the title of the window, i.e. the string you passed into stage.setTitle() in your JavaFX application entrypoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants