This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I've been tasked with looking at a possible solution for integrating an application with and external java GUI application.
The problem is that this external GUI java application, does not have any API, web services, and of course we have no access to source code - which would facilitate integration.
Is there any clever way to "drive" this GUI based on triggers from our other application? Any API's outther that offer this functionality?
Previously, there was a very adhoc solution. Very inefficient and error prone. Previous developers were using the GUI testing framework Marathon to record different scenarios and create "test scripts" - which they would later call and pass parameters to and the external GUI app would look as if it was "integrated" some how.
My recommendation was that doing the same thing was not a good approach. Is there anything out there that would help me do what I am trying to achieve?
Abbot is a framework for writing Swing tests. JFC Unit also sounds like it fits that area, but I've never tried it.
Joined: Apr 22, 2010
Thank you very much. I am currently looking at Abbot, but will take a look at JFC Unit. Now, given that this frameworks were developed specifically for testing - which assumes you wrote the GUI and know its structure - do you think it would be a good solution to use them to drive the java GUI from another app?
Previously, a solution was implemented using Marathon. But its a poor solution because every time they change a label, button, window name, etc. the "integration" breaks, and the testing scripts have to be changed to accommodate the new change.
I'm trying to convince my supervisor that this is not the way to go - but I still want to look further into it. May be there is a better approach.
Do you have the code for this other app? Do you expect it to change? If you don't have the code, I think it would be harder to test. If it changes frequently, I recommend working with the developers that do own it. Or get them to test it!
Joined: Apr 22, 2010
No, I do not have the code for this app and it does change - they update it every few months.
Having said that - my task is not to test the application. The application by itself works very well, I am sure the developers have done a good job of testing.
What I am being tasked with is to find a way to interact with it programmatically from our other app. Since its a GUI and we will not be provided either with an API or another means of interaction such as web services, the previous developer's solution was to use Marathon - a very adhoc, error prone solution. Though very imaginative and it was working well until a new design of the app came out and the solution broke for good.
Basically we would create different "test scripts" (Jython) based on the different scenarios the users would need to run. We would then make the parameters to the test scripts so that they could be dynamically read from and XML file.
Our app would then write this XML parameter file and initiate Marathon - thus giving the user the illusion that the java app was being driven by the inputs he was giving our app.
That is why I need some advice from a more advanced java user. I've never done anything like this in my years developing Java and I see a lot of cons to this solution. May be there is some framework out there designed to do this? If not I can always recommend this is not a good solution.
author & internet detective
In that case, no tool is going to solve the problem. If the team changes the interface every few months, any code you write to access it will also break periodically.
I think the best thing is to ask them for an API you can call. They are internal to your organization, yes? If so, it is a better investment of resources to have something stable. Even if you have to spend some time working with them ONCE to get it done.