Got feedback about SWTBot ? [message #43578] |
Wed, 15 July 2009 12:54  |
Eclipse User |
|
|
|
Chris from the PDE fame pointed me to a comparison of UI testing tools
that also features SWTBot.
http://wiki.eclipse.org/Automated_Testing#UI_tests
The good news is that we're being watched :)
There is also some nice and straight feedback on some of the cons of
SWTBot which certainly need improvement:
- lack of documentation
- record/playback support
- some long pending open issues
- lack of support for testing native dialogs
I would also like to hear from the swtbot community about what you feel
are the pain points you've experienced when you got started with swtbot.
Do you have any ideas on how *your* experience could have been better ?
I'm looking forward to any sort of feedback you may have to make swtbot
better. You may write directly on this list(preferred) or privately to me.
Cheers!
--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
|
|
|
|
|
|
|
Re: Got feedback about SWTBot ? [message #44457 is a reply to message #44334] |
Tue, 21 July 2009 07:41   |
Eclipse User |
|
|
|
Steven Chamberlin wrote:
>> The worst issue I had so far when writing tests with SWTBot is
>> synchronization issues. It's easy to try to synchronize your testing
>> thread with the UI thread and doing it the wrong way. I had to do
>> multiple iteration to achieve something relatively stable and
>> (hopefully) inside the good practice guidelines. Most of the time this
>> happened when I had to validate the state of the UI.
>
> Hi Pascal / Ketan,
>
> I found this interesting. I wonder if it might be related to my issue.
>
> The biggest pain point I am currently experiencing with SWT-Bot is that
> I am experiencing random intermittent failures in my test code that seem
> to be related to some kind of timing / synchronization issue. Code that
> previously worked in a prior run will fail with
> org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion: The
> widget was null.
>
> at different places in the code. ...then I'll run it again and it'll be
> fine.
>
> Anyone else experience this and anyone have tips about how to fix these
> kinds of intermittent issues? I wonder if it might be because the UI is
> locked up due to some busy function/job on the ui thread. I think
> Eclipse might get in a busy state, similar to when the UI is temporarily
> frozen due to some 'long' running function/job on a UI thread. Is there
> a utility for checking or handling such a situation, or could this be
> built in to SWT-Bot itself? Why doesn't SWT-Bot keep trying until the
> timeout period is expired?
>
> If my testcases fail on their own intermittently because of timing
> issues in the framework or Eclipse, then I will have a lot of false
> negatives and the solution would not be workable / scalable.
> Suggestions very much appreciated ... Thanks!
>
> -- Steve
>
>
I had this issue myself with certain of my tests. One of the problem I
had was with the Display.post() method in eclipse 3.4 on Linux/GTK: it
caused a deadlock in the UI thread and I has to restart the tests. It
got fixed in eclipse 3.5 so now I'm running with 3.5.
The other issue I had was with the update of the UI was slower then I
had expected. The biggest pain I had was with a JFace TreeViewer with
columns, which was populated each time my underlying model changed. I
wasn't doing any synchronization prior to check the UI state. For
exemple, each time I changed something in the model, I did this kind of
check:
// Change the model with some action: model.setFoo("bar");
SWTBotTreeItem item = bot.tree().getTreeItem("foo");
assertEquals("The model was not changed!", item.cell(2), "bar");
This sometime worked, sometime it threw WidgetNotFoundException, and
sometime it was SWTError: Widget is disposed. What I do now instead is:
bot.waitUntil(new DefaultCondition()
{
public boolean test() throws Exception
{
SWTBotTreeItem item = bot.tree().getTreeItem("foo");
return item.cell(2).equals("bar");
}
public String getFailureMessage()
{
return "The model was not changed!";
}
}
This method has the advantage of synchronizing with the UI, as the
condition will be tried periodically until the default timeout happens,
which is 5 seconds. If the 5 seconds is not enough, then you can make it
longer by changing SWTBotPreferences#TIMEOUT. Of course, if you have a
long running job in the UI thread then the problem is not really with
your tests, but with the design of that job. I also don't think there is
direct support for checking long running job (with a progress monitor
and all, such as the synchronizing with CVS job) in SWTBot, but I'm
pretty sure there is a quick workaround for this.
Hope this helps
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
|
|
|
|
Re: Got feedback about SWTBot ? [message #545587 is a reply to message #43578] |
Thu, 08 July 2010 06:39  |
Eclipse User |
|
|
|
Hi,
I've been using SWTBot for some testing, but my testing framework is built on TestNG, what I tried to do was use both TestNG and JUnit annotations, eclipse handles this well but SWTBot (headless) seems to ignore the test as soon as I introduce TestNG annotations in the same class. Any idea why?
And sorry if this is not the place to post this.
Regards,
Rick Gomes
|
|
|
Powered by
FUDForum. Page generated in 0.05489 seconds