I would like to stress test a win32 application by sending a lot of random keystrokes to it, and I wonder if anyone could point me to some software I could use. Ideally, I should be able to specify which keystrokes can be sent, and control rate (random min/max).
-
LOL, that doesn't make it random doesn't it? :P – Jon Limjap Oct 27 '08 at 10:20
-
yeah, I should rephrase that indeed – Drealmer Oct 27 '08 at 10:22
4 Answers
Have a look at the Fuzz Testing of Application Reliability website of the University of Wisconsin. They did a research study some years ago to test the reliability of desktop software and on that page you find a link to their FTP site providing fuzz testing tools.
I've used the fuzz-nt tool from that site for my own tests and successfully found several bugs in our application. It has no option to choose the keyboard input values (but source is provided). Instead it lets you choose from these sources of random data:
- random keyboard events
- random mouse events
- random windows events (to be used with care or better not at all)

- 21,797
- 8
- 68
- 88
Have a look at AutoIt. It has a COM interface, so you can script it from any language that supports COM. I've written Python scripts to automate GUIs.

- 487
- 2
- 8
I would use a macro software, like AutoIt, as jrbushell said, or AutoHotkey. They also allow random clicks... :-) Both are free.

- 40,535
- 6
- 96
- 134
Here's a pseudocode (since you didn't mention the language you're using):
- Create an array that contains the alphabet from a-z, A-Z, 0-9 (depending on what keys you wish to send)
- for i = 0 to NumberOfKeyStrokes
- rand() % SizeOfArray
- delay for rand() milliseconds (the lower the range, the faster the key strokes are)
- send via an API or as a string
For more information on sending a keystrike to an application on windows, research the API FindWindow and SendMessage

- 8,515
- 10
- 56
- 79
-
1Thanks but I am more looking for a tool to do this... that's why I didn't specify a language in my question. And besides that, why did you remove the "monkey" keyword on my post? this is the name of the technique: http://en.wikipedia.org/wiki/Monkey_test – Drealmer Oct 27 '08 at 10:41