I'm currently planning to build a very simple Test program using C++.
I wish to create a program which in its simplest level can do the following:
- open a target program
- press a range of buttons (at set intervals and in set order)
- keep a logfile of all actions performed
- stop the program and report if something unexpected occurs.(no analysis or anything)
That's it really - very simple. I don't need anything complicated.
Maybe someone can help me here - all I need is a few simple functions in C++ (like "Press Button at x,y" or "Move active window x,y") to get me started. Maybe someone has already done this, and created a simple tool or there is source availble as examples somewhere?
thanks for the reply, I will probably use both approaches - one to utilise a scriping language which already incorporates the functions that I need and the second to build up these functions from scratch (also as a programming excercise in C++)
Sounds like you are trying to write a program to interact with another program...
On a windows platform testing Win32 apps you'll probably need an API function called "SendInput" this allows you to simulate keyboard and mouse input by generating messages and sending them to the appropraite applications's message queue. The app then processes these as if they came from the keyboard and mouse.
You'll also need to look up functions such as FindWindow and FindWindow_Ex.
Also try http://msdn.microsoft.com/msdnmag/is.../03/Bugslayer/
It's the 3rd in a series of articles on building a simple macro recorder...might be just what you're looking for.