Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Click always timeout for Swing JButton(Swing Application Testing Problem)
Click always timeout for Swing JButton [message #893119] Mon, 02 July 2012 17:18 Go to next message
Keiichiro Ono is currently offline Keiichiro OnoFriend
Messages: 2
Registered: July 2012
Junior Member
Hi.
I'm trying several testing frameworks for an open source application called Cytoscape, and seems Jubula is a good tool for our purpose (automate testing for a Swing application).

However, I have one critical issue and cannot test actual application.

Here is what I've done as a toy example:

1. Create a new test, and set up an AUT (specified cytoscape.sh script as its executable)
2. Connect to AUT agent. Cytoscape starts running.
3. Create a test suite
4. Create a test case by recording a single click (open a file JButton). Then stop recording.
5. Add the test case to the suite
6. Run the test.

Then, this very simple test always fails by timeout. This is weird because I can finish other simple test cases, like find a specific JButton or JTextField and make sure it's enabled, but somehow test case with button click always fails even if I set a long wait between steps. Do I misunderstand something or are there any alternative way to avoid this problem? Configuration is attached as a text file.

Thanks in advance.
Kei (Cytoscape Core Developer Team)
Re: Click always timeout for Swing JButton [message #893247 is a reply to message #893119] Tue, 03 July 2012 10:45 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi,

My first thought is that it has something to do with focus behaviour. From the settings file you attached I saw you are working on a Mac. Macs are different from Windows and Linux, because the next application in line doesn't automatically get focus when the application before it is minimized. Have you tried making sure the AUT is in focus before trying the click? You ca try it manually (by clicking into the AUT when the test starts) and there is an action to do this automatically in the unbound modules. (You might want to have a go through the Cheat Sheets, which can be started from the help menu, to learn about writing tests with the unbound modules).

HTH,
Alex
Re: Click always timeout for Swing JButton [message #893365 is a reply to message #893247] Tue, 03 July 2012 17:33 Go to previous message
Keiichiro Ono is currently offline Keiichiro OnoFriend
Messages: 2
Registered: July 2012
Junior Member
Hi Alex.

I've just added one extra step to focus on the main application window at the beginning of the test suite, and now it works as expected. Seems all Swing apps on Mac need this step to make test suite running.

Thanks a lot!

Kei
Previous Topic:AssertException
Next Topic:Name of recorded components
Goto Forum:
  


Current Time: Tue Mar 19 09:00:52 GMT 2024

Powered by FUDForum. Page generated in 0.01585 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top