Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » macosx experiences
macosx experiences [message #34336] Sun, 03 May 2009 16:23 Go to next message
Richard Adams is currently offline Richard Adams
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Hello,
I have been using SWTBot (the net.sf version 1.3.0) quite happily for a
while, using WindowsXP, and EClipse 3.4.1, and our RCP project has about
50 GUI tests now. Recently we started developing on Macosx, and we have
noticed that the same test suite passes /fails apparently randomly -
usually several tests fail, which are different each time. Many of our
tests manipulate a dialog or wizard, and then check for the creation or
modification of a workspace resource. We spent quite some time making this
robust for Windows - i.e., adding 'wait' conditions and it is a bit
puzzling why we get the unpredictable behaviour on the Mac, which makes
the test suite very unreliable. I should say these tests are run from
Eclipse, not from Ant.
So we tried upgrading to SWTbot version 2, in case that might help- but
have so far been unable to create any sort of test to run at all.
1. We removed the net.sf.swtbot plugins
2. Added SWTBot 2.0.0.204 feature from the update site
3. Followed the instructions which we eventually found in Ketan's
EClipseCon2009 presentation.
4. Using junit3, we always get the 'no testable methods found'.
5. Using junit 4, and the MyFirstTest example, a new instance of
Eclipse launches, the @BeforeClass method is executed, but the @Test
method is not run. Eventually runtime eclipse exits, with no junitreport
generated.

Has anybody else had these problems? Any ideas for fixes?
Thanks
Richard


Re: macosx experiences [message #34368 is a reply to message #34336] Mon, 04 May 2009 05:35 Go to previous messageGo to next message
Richard Adams is currently offline Richard Adams
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Sorry, hanging test was caused by an exception in the BeforeClass method
of the example code ,as the 'Welcome' page is not displayed.
So. got the example running. But strange Mac behaviour persists with my
own tests.
E.g., I have a dialog with 3 text boxes. The text boxes initially contain
default values. When one is edited, the two others update their values
using ModifyListeners. I have some test code that manipulates a text box,
then checks the other 2 text boxes have updated correctly.

E.g.,
<code>
bot.textWithLabel("Time").setText(""); // should clear existing value but
doesn't.
bot.waitUntil (new DefaultCondition (){
public boolean test () throws Exception {
return bot.textWithLabel("Time").getText().equals("");
}
});
bot.textWithLabel("Time").typeText(NEWVALUE);



</code>
What happens is that the setText("") appears to have no effect.
E.g., if the default value is '100' and I want to replace this with '200'
the textbox ends up holding '100200' which breaks the test on Mac but not
windows.
Is there a better way of voerwriting text boxes?
Thanks
Richard


Re: macosx experiences [message #34503 is a reply to message #34368] Mon, 04 May 2009 18:36 Go to previous messageGo to next message
Ketan Patel is currently offline Ketan Patel
Messages: 68
Registered: July 2009
Member
I am not 100% sure but I think the "withLabel" methods changed the way
they found widget from 1.3 to 2.0. You might want to search this mailing
list or the bugs to find more information on it.

To verify this is the case, you might want to try using just the text
method to make sure. My guess is that it is finding a different text
widget.
Re: macosx experiences [message #34637 is a reply to message #34503] Wed, 06 May 2009 05:56 Go to previous message
Richard Adams is currently offline Richard Adams
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Thanks for the tip,
I have tried every variant of textInGroup, texttAtIndex, with the same
result.
I've also tried keeping a reference to the SWTBotTExt object, rather than
using
bot.textWithLabel() several times, again with no change.
I'll file a bug report.
Cheers
Richard


Previous Topic:Generating SWT.Arm events with SWTbot?
Next Topic:Eclipse 3.4.2 Ganymede supported by SWTBot?
Goto Forum:
  


Current Time: Sat Aug 23 13:36:20 EDT 2014

Powered by FUDForum. Page generated in 0.08478 seconds