find exception

5 views
Skip to first unread message

Lilly

unread,
Jul 10, 2009, 1:16:40 PM7/10/09
to easytesting
Hi,

As you know I am trying to use SWTBot for RCP and FEST for swing.

I was able to extract the swing component using SWTBot and pass it on
to FEST. FEST could get a handle on the topmost panel and I was able
to simulate a right click event using FEST.

However, FEST is unable to find any other component that is inside of
this outermost jpanel.

Any ideas how this can be solved?

Does FEST check the top most parent of the component for starting its
search?

As I said that swing component is embedded with in RCP, and so its
parent is
org.eclipse.albireo.core.SwingControl$ToplevelRootPane, whose parent
is
sun.awt.windows.WEmbeddedFrame

Again thanks for you help.

Lilly

Alex Ruiz

unread,
Jul 10, 2009, 2:48:56 PM7/10/09
to easyt...@googlegroups.com
Hi Lilly,

I'm guessing org.eclipse.albireo.core.SwingControl$ToplevelRootPane is a JPanel. If that's the case you can use a JPanelFixture to wrap it. JPanelFixture has lookup methods to search for components inside a JPanel.

Regards,
-Alex

Alex Ruiz

unread,
Jul 13, 2009, 10:54:55 AM7/13/09
to Chandrasekhar, Lalitha, easytesting
Can you please post the stack trace?

Also, you can send any attachment to the mailing list. Just send an e-mail to easyt...@googlegroups.com

I'm cc-ing this message to the mailing list.

Cheers,
-Alex

On Mon, Jul 13, 2009 at 5:00 AM, Chandrasekhar, Lalitha <Lalitha.Ch...@compuware.com> wrote:

Alex,

As I could not paste the image on to google group, I am emailing to you. Here is part of my code that

gets the swing component which is a JPanel.

private

JPanelFixture window;

JComponent stSwingPanel = stSwing.getSwingComponent();

window = new JPanelFixture(robot(), (JPanel)stSwingPanel);

The window panelFixture gets created.

JPanelFixture p = window.panel("Service Tree Main Panel");

However, it throws an exception when trying to find Service Tree Main Panel. 

As you can see from the following "Sevice Tree Main Panel" does exist. Why is it not able to find it?
 
Thanks for your help.
 
 
 

Lalitha Chandra

Products Division
Compuware Corporation
313-227-4132
lalitha_ch...@compuware.com

 

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.


Outlook.jpg

Lalitha Chandrasekhar

unread,
Jul 13, 2009, 11:49:56 AM7/13/09
to easyt...@googlegroups.com


---------- Forwarded message ----------
From: Chandrasekhar, Lalitha <Lalitha.Ch...@compuware.com>
Date: Mon, Jul 13, 2009 at 11:32 AM
Subject: FW: find exception stack trace
To: lalitha...@gmail.com


 



 
 


Outlook.jpg

Lilly

unread,
Jul 13, 2009, 1:07:18 PM7/13/09
to easytesting
Alex,


Here is the stacktrace for the test.

This is the code :
JPanelFixture panelFixture = new JPanelFixture(robot(), (JPanel)
stSwingPanel);

//The above panel i.e. stSwingPanel is the ''Service Tree Manager''
panel.
//The panel inside this panel is Service Tree Main Panel

JPanelFixture mainPanel = window.panel("Service Tree Main Panel");

org.fest.swing.exception.ComponentLookupException: Unable to find
component using matcher org.fest.swing.core.NameMatcher[name='Service
Tree Main Panel', type=javax.swing.JPanel, requireShowing=false].

Component hierarchy:
com.proxima.centauri.advancednavigator.manager.ServiceTreeManager
[name='Service Tree Manager']

at org.fest.swing.core.BasicComponentFinder.componentNotFound
(BasicComponentFinder.java:255)
at org.fest.swing.core.BasicComponentFinder.find
(BasicComponentFinder.java:244)
at org.fest.swing.core.BasicComponentFinder.find
(BasicComponentFinder.java:239)
at org.fest.swing.core.BasicComponentFinder.findByName
(BasicComponentFinder.java:181)
at org.fest.swing.fixture.ContainerFixture.findByName
(ContainerFixture.java:429)
at org.fest.swing.fixture.ContainerFixture.panel
(ContainerFixture.java:224)
at
com.compuware.vantage.vsm.client.rcp.swtbottest.vsmNavigatorTestCase.testDialog
(vsmNavigatorTestCase.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at org.eclipse.swtbot.swt.finder.SWTBotTestCase.runBare
(SWTBotTestCase.java:228)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run
(OldTestClassRunner.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:386)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main
(RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests
(UITestApplication.java:123)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run
(WorkbenchTestable.java:68)
at java.lang.Thread.run(Thread.java:595)

On Jul 13, 11:49 am, Lalitha Chandrasekhar <lalithachan...@gmail.com>
wrote:
> ---------- Forwarded message ----------
> From: Chandrasekhar, Lalitha <Lalitha.Chandrasek...@compuware.com>
> Date: Mon, Jul 13, 2009 at 11:32 AM
> Subject: FW: find exception stack trace
> To: lalithachan...@gmail.com
>
>
>
>  Outlook.jpg
> 191KViewDownload- Hide quoted text -
>
> - Show quoted text -

Alex Ruiz

unread,
Jul 13, 2009, 6:08:22 PM7/13/09
to easyt...@googlegroups.com
Pretty weird. I'm going to ask the obvious: are you sure ServiceTreeManager has the panel you are looking for? It seems that from the hierarchy it is empty.

If is not empty, and the panel you are currently looking for is in ServiceTreeManager, then there is a bug in FEST. Can you send me a reproducible test case? That I can make sure it will be included in our next release on August 3rd.

Thanks,
-Alex

csaba.juhos

unread,
Jul 14, 2009, 12:14:49 PM7/14/09
to easytesting
Hi Lilly,

You could use Swing Explorer to make sure that the component you're
looking for is really in the component tree.
There's a nice plugin for eclipse and the site says that netbeans is
supported as well.

Hope this helps,
Csabi

https://swingexplorer.dev.java.net/

Alex Ruiz

unread,
Jul 14, 2009, 1:24:18 PM7/14/09
to easyt...@googlegroups.com
Excellent suggestion Csabi! I'll be adding it to our wiki in the section "troubleshooting" :)

Thanks!
-Alex

Lilly

unread,
Jul 15, 2009, 8:08:27 AM7/15/09
to easytesting
Csabi,

Thanks for the suggestion. However I am not able to find any of the
components within the swing panel after I extract the swing panel from
RCP.

Next week I am going to try to recreate the issue with sample code and
post it.

Thanks again,

Lilly
> > com.compuware.vantage.vsm.client.rcp.swtbottest.vsmNavigatorTestCase.testDi­alog
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages