com.l2fprod.common.swing.JOutlookBar - any idea how to get access to JTabbedPane from this component?

141 views
Skip to first unread message

Marcin Sanecki

unread,
Jan 3, 2013, 9:16:33 AM1/3/13
to easyt...@googlegroups.com
Hi,
I am going through my application writing test with help of fest-swing and now I have a not standard Swing component (com.l2fprod.common.swing.JOutlookBar)
I have been trying to write any test using ContainerFixture.tabbedPane("someName") without luck.
The only way I can get this JOutlookBar component is robot().moveMouse(...) etc.
Any idea how to do it not using java.awt.Robot?

Here is very simple demo project for those of you who want to look at the code: https://github.com/msanecki/fest-swing-example.git

Take care,
Marcin

Marcin Sanecki

unread,
Jan 25, 2013, 4:48:48 AM1/25/13
to easyt...@googlegroups.com
I found the work-around for this. It works (at least it is possible to click any element, what I really needed) but I am outside the fest fixture.

JTabbedPane jTabbedPane = ContainerFixture.tabbedPane("someName").component();
jTabbedPane.setSelectedIndex(0);

Alex Ruiz

unread,
Jan 25, 2013, 9:28:11 AM1/25/13
to easytesting
Great!

Please make sure you are calling "setSelectedIndex" in the EDT, using FEST's GuiTask.

Cheers,
-Alex


--
You received this message because you are subscribed to the Google Groups "easytesting" group.
To post to this group, send email to easyt...@googlegroups.com.
To unsubscribe from this group, send email to easytesting...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Marcin Sanecki

unread,
Jan 26, 2013, 10:08:06 AM1/26/13
to easyt...@googlegroups.com
Hi Alex,
thanks for pointing this out. I am introducing automated GUI tests in some project and besides standard Swing components there are also some other UI components from 3rd part libs. All of them rely on Swing but it is not possible tu use fest-swing fixtures for all of them. Do you know what could be the problem?

Take care,
Marcin

Alex Ruiz

unread,
Jan 28, 2013, 2:08:32 PM1/28/13
to easytesting
That is a very difficult question to answer without knowing how those components are implemented. The best suggestion I can give you is to use Swing Explorer to see how's the structure of such components. Here is an article that shows how to do it: http://www.ibm.com/developerworks/java/library/j-swingtest/

Cheers,
-Alex
Reply all
Reply to author
Forward
0 new messages