Build time errors in test file while imorting private class

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Build time errors in test file while imorting private class

Postby adeel976 » Fri Sep 04, 2009 3:32 am

I am getting some build errors in import section of recorded test file.

1- My recorded test file importing one of my product specific class that gives the following error.
"The type com.xyz.xyz.designer.ui.editor.template.layout.LayoutSelector$LayoutTableCursor is not visible"

2- Another error in header file:
Access restriction: The type ValueEditControl is not accessible due to restriction on required library D:\eclipse-designer\eclipse\plugins\com.xyz.xyz.designer.ui_1.5.0.20090827\ui.jar

My guess is these errors are due to access private classes in code. Is there any work around for these errors?
please help me.

Note: in above error messages i replaced our product specific naming conventions with 'xyz' manually.
adeel976
 
Posts: 4
Joined: Thu Sep 03, 2009 12:06 am

Re: Build time errors in test file while imorting private class

Postby Phil Quitslund » Fri Sep 04, 2009 8:13 am

Could you send the generated locator(s)? I'll try and and put together a work-around. The trick is to build a locator that refers to the class by name (rather than by .class) as in this constructor:

http://downloads.instantiations.com/WindowTesterDoc/integration/latest/docs/html/reference/javadoc/com/windowtester/runtime/swt/locator/SWTWidgetLocator.html#SWTWidgetLocator%28java.lang.String%29

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Build time errors in test file while imorting private class

Postby adeel976 » Mon Sep 07, 2009 2:31 am

Hi Phil,
Here is the generated locator from windowtester;
import com.xyz.xyz.designer.ui.editor.template.layout.LayoutSelector$LayoutTableCursor;

ui.click(new XYLocator(new SWTWidgetLocator( LayoutSelector$LayoutTableCursor.class), 73, 62));

The build errors were removed by doing these changes, but application stopped while executing this widgetlocator.
// import com.xyz.xyz.designer.ui.editor.template.layout.LayoutSelector$LayoutTableCursor;

ui.click(new XYLocator(new SWTWidgetLocator("com.xyz.xyz.designer.ui.editor.template.layout.LayoutSelector$LayoutTableCursor"), 73, 62));
adeel976
 
Posts: 4
Joined: Thu Sep 03, 2009 12:06 am

Re: Build time errors in test file while imorting private class

Postby Phil Quitslund » Mon Sep 07, 2009 8:29 am

When you say stopped, was an exception thrown? Did the widget appear to get clicked? If there was an exception, could you post the stack trace?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Build time errors in test file while imorting private class

Postby adeel976 » Mon Sep 07, 2009 10:05 pm

Hi phil,
Test exits without clicking on widget that have problem, here is the Failure stack.

Code: Select all
The type com.xyz.xyz.designer.ui.editor.template.layout.LayoutSelector$LayoutTableCursor is not visible
com.windowtester.runtime.WidgetNotFoundException: Widget NOT Found:
SWTWidgetLocator(com.xyz.xyz.designer.ui.editor.template.layout.LayoutSelector)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:609)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.runtime.swt.internal.UIContextSWT.find(UIContextSWT.java:584)
   at com.windowtester.internal.runtime.selector.ClickHelper.doFind(ClickHelper.java:192)
   at com.windowtester.internal.runtime.selector.ClickHelper.click(ClickHelper.java:58)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:87)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:297)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:80)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:305)
   at com.windowtester.internal.runtime.UIContextCommon.click(UIContextCommon.java:73)
   at com.windowtester.runtime.swt.internal.UIContextSWT.click(UIContextSWT.java:288)
   at testpackage.test11.testtest11(test11.java:57)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at junit.framework.TestCase.runTest(TestCase.java:164)
   at junit.framework.TestCase.runBare(TestCase.java:130)
   at com.windowtester.runtime.common.UITestCaseCommon.access$0(UITestCaseCommon.java:1)
   at com.windowtester.runtime.common.UITestCaseCommon$2.run(UITestCaseCommon.java:136)
   at com.windowtester.runtime.common.UITestCaseCommon$3.run(UITestCaseCommon.java:157)
   at com.windowtester.internal.runtime.junit.core.SequenceRunner$1.run(SequenceRunner.java:46)
adeel976
 
Posts: 4
Joined: Thu Sep 03, 2009 12:06 am

Re: Build time errors in test file while imorting private class

Postby Phil Quitslund » Tue Sep 08, 2009 12:23 pm

In the place where you attempt the click, could you insert the following debugging hook and post the console output?

Code: Select all
com.windowtester.swt.util.DebugHelper.printWidgets()
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Build time errors in test file while imorting private class

Postby adeel976 » Wed Feb 03, 2010 12:52 am

Hi Phil,

I actually came back to this project after quite some while, so lets continue with this thread because I still haven't been able to solve this problem.

Here is the relevant part of the output on console, I have attached a file with the complete output:
Code: Select all
Composite {}<HC|14898987>
    Composite {}<HC|10682578>
     Composite {}<HC|25877854>
      CTabFolder {}<HC|30112884>
       CTabItem {Layouts/Classes}<HC|5747181>
       CTabItem {States/Actions}<HC|23225795>
       CTabItem {Settings}<HC|17231391>
       Composite {}<HC|33251278>
        FlyoutPaletteComposite {}<HC|4987052>
         FlyoutPaletteComposite$Sash {}<HC|31982318>
          [FlyoutPaletteComposite$ButtonCanvas {}<HC|22516384>]->(invisible)
          [FlyoutPaletteComposite$TitleCanvas {}<HC|5990634>]->(invisible)
           Menu {}<HC|13234974>
         FlyoutPaletteComposite$PaletteComposite {}<HC|18375819>
          FlyoutPaletteComposite$TitleCanvas {}<HC|21295199>
           Menu {}<HC|7891524>
          FlyoutPaletteComposite$ButtonCanvas {}<HC|16849339>
          FigureCanvas {}<HC|21003500>
           Menu {}<HC|18961304>
           ScrollBar {}<HC|13206327>
           ScrollBar {}<HC|29724744>
           SashForm {}<HC|25394802>
            LayoutSelector {}<HC|31617329>
             Label {Menu:}<HC|10582134>
             Combo {menu://Menus/root.menu}<HC|15446862>
             Label {Active Slot:}<HC|4779087>
             Combo {no slot (first active)}<HC|26366823>
             Label {Editing modes:}<HC|27372991>
             ContextSelector {}<HC|26597493>
              ToolBar {}<HC|6347528>
               ToolItem {} No ActionContributionItem <HC|13373796>
               ToolItem {} No ActionContributionItem <HC|25817858>
               ToolItem {} No ActionContributionItem <HC|28395435>
               ToolItem {} No ActionContributionItem <HC|30948039>
               ToolItem {} No ActionContributionItem <HC|16453888>
             Label {Layouts:}<HC|11935873>
             Table {}<HC|17830724>
              Menu {}<HC|25729453>
              ScrollBar {}<HC|18429248>
              ScrollBar {}<HC|32971273>
              TableItem {default}<HC|30300248>
              TableColumn {}<HC|653909>
              LayoutSelector$LayoutTableCursor {}<HC|17951667>
               Menu {}<HC|25729453>
            AnimationSelector {}<HC|24479617>
             LayoutComposite {}<HC|25779276>
              ToolBar {}<HC|29234995>
               ToolItem {} null id <HC|15276663>
               ToolItem {} null id <HC|29924857>
              ToolBar {}<HC|15020245>
               ToolItem {} null id <HC|33249481>
               ToolItem {} null id <HC|8526090>
               ToolItem {} null id <HC|20579248>
             Composite {}<HC|17476716>
              Table {}<HC|29891460>
               ScrollBar {}<HC|8827256>
               ScrollBar {}<HC|15548839>
               TableColumn {Initial State}<HC|7429444>
            Sash {}<HC|18042600>
         Composite {}<HC|7408190>
Attachments
widgets.txt
(47.21 KiB) Downloaded 42 times
adeel976
 
Posts: 4
Joined: Thu Sep 03, 2009 12:06 am

Re: Build time errors in test file while imorting private class

Postby Phil Quitslund » Tue Feb 09, 2010 2:51 pm

Thanks for this. Do you have control over the application source? Would naming the widget be feasible?

http://downloads.instantiations.com/WindowTesterDoc/integration/latest/docs/html/programmer/core/naming_widgets.html
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest