Automation of Java Swing apps
We are evaluating some tools, namely QuickTest Pro and qftestJUI (or something like that) for the ability to automate our Java Swing application. The basic stuff works fine. We can start up our app, record/playback a simple script that opens a file, uses menus, etc.
The nasty issues hit us when we try to handle a section of our product that is a big Java JPanel (canvas) that we paint ourselves. Using JComponent and such would be too costly as we could have hundreds of them on the canvas and all of them being repainted would be ineffecient. What we have is very slick, powerful and very smooth and fast. It works great, and it would require a major rearchitecture to change.
It seems we can record/playback somewhat, but the script doesn't find any components or anything in the painted area, naturally, so it goes into a sort of quasi-relative position mode, where every action is based on relative x,y locations, I am guessing from the upper left.
I can understand why this happens, there is no way for the automation frameworks (both tools do this) to find actual Component objects, they simply dont exist since they are painted.
So how is anyone out there doing this? How about with custom components?
Is there any ability to put our own java code in a script, such that the java code when executed can access our running applications internal APIs?
The thing is, we are using jfcUnit and coding up our automation, which works great for most things. But the tradeoffs to this is that our QA team has to know Java and at that they must be pretty good with Swing, awt, event queues, jfcUnit, java itself and more. I am all for this, but our off-shore team is skilled in tools like WinRunner/SilkTest and thus it's far easier to find that sort of skill than a developer willing to write automation code.
What I am doing is working with my Java Swing Developer and they are create Java Instances & Methods for me to run and get 'X' & 'Y' coordinates for <CLICK> and for Color Verification a Method return the Hex value of the color of the background color.