Problem with LayoutComposite

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

Problem with LayoutComposite

Postby Natalia K » Wed Sep 09, 2009 3:25 am

Hi for all,
We are in the process of searching a good UI testing tool for Eclipse RCP software.
We are testing Window Tester and should decide in 1 day - whether we will buy it or not.
But we meet a problem with test code, that WT generates. And cannot really test anything at all because of it.

The problem:
We have just recorded a small scenario, but when we save the result test the java project in unable to resolve one of the classes that is in the test code.
Code: Select all
ui.wait(new ShellShowingCondition("Configuration Wizard"));
    ui.click(new SWTWidgetLocator(Text.class, new LabeledLocator(
       LayoutComposite.class, "Name:")));
    ui.enterText("d1");

The generated code contains link to class org.eclipse.ui.forms.widgets.LayoutComposite which has default visibility.
That's why test code cannot be compiled.

The questions are:
Why it happens? Is it a known bug? Or what?....
Maybe we did something wrong?
How we can fix this due to be able to test WT and make a decision.

We also found that not only we met this problem:
http://www.instantiations.com/forum/viewtopic.php?f=5&t=1918&p=6953&hilit=LayoutComposite#p6953

Some info:
We are using Eclipse 3.5 as a target platform for our software.
Product name: Window Tester
Version: 3.9.1
OS Name/Version: Windows XP
Priority: Critical
Eclipse Log Attached: No

We are really looking forward to your answer.

Thank you beforehand,
Natalia
Natalia K
 
Posts: 2
Joined: Wed Sep 09, 2009 2:38 am

Re: Problem with LayoutComposite

Postby Phil Quitslund » Wed Sep 09, 2009 1:57 pm

You didn't do anything wrong. This is a limitation in the recorder. A few things to try:

1) Does this work?:
Code: Select all
ui.click(new LabeledTextLocator("Name:"));


2) Do you have access to the source? If so, perhaps you could consider naming the widget in question.
http://downloads.instantiations.com/WindowTesterDoc/integration/latest/docs/html/programmer/core/naming_widgets.html

Let us know how you fare!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Problem with LayoutComposite

Postby Natalia K » Thu Sep 10, 2009 4:54 am

Hello, thank you for the reply.
We have used second approach and it helped.

But we also have found some other incomprehensible behavior cases or bugs.

1. When we try to reach not visible at the moment widgets - we use scroll down. But scroll down event is not recorded at all. So test fails because WT doesn't do scroll in playing and cannot set correct values to such invisible widgets.

2. WT also doesn't write down F2 pressed event. We need to correct this manually in the source code of test after recording.

Could you please give us some workarounds or advices?

Thank you very much,
Natalia
Natalia K
 
Posts: 2
Joined: Wed Sep 09, 2009 2:38 am

Re: Problem with LayoutComposite

Postby Phil Quitslund » Thu Sep 10, 2009 8:13 am

Glad that helped. As for your follow-ups.

1. Scroll events are not recorded but selections should be. At playback time, offscreen widgets should get automatically revealed before they are selected. If you are not seeing this, please submit a bug report.

2. Keystrokes (such as F2) that are managed at the application level never reach the SWT Display (or widgets) and so our recorder never sees them. The work-around is to inject these keystrokes manually into the test case (such as ui.keyClick(WT.F2)) or to use other UI actions that trigger the same functionality (such as an associated menu item selection).
--
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