Skip to main content



      Home
Home » Eclipse Projects » SWTBot » view not really closing
view not really closing [message #1611967] Wed, 11 February 2015 13:41 Go to next message
Eclipse UserFriend
Hi,

I have a weird problem which occurs from time to time (in the last time
more on Yosemite...).

I run an Eclipse based product as SWTBot test (Run As... JUnit Plugin
Test). First the test trues to close the welcome view. E.g.

@BeforeClass
public static void beforeClass() throws Exception {
bot = new SWTWorkbenchBot();
bot.viewByTitle("Welcome").close();
}

However, the view is not really close. Repeating the close command would
lead to an exception (view not found anymore). Since the view is not
really closed, all succeeding tests fail of course.

Do I miss anything? I already played around with bot.sleep but that did
not help. Any ideas?

Cheers,
Jens
Re: view not really closing [message #1613051 is a reply to message #1611967] Thu, 12 February 2015 06:24 Go to previous message
Eclipse UserFriend
On 11/02/2015 19:41, Jens v.P. wrote:
> Hi,
>
> I have a weird problem which occurs from time to time (in the last time
> more on Yosemite...).
>
> I run an Eclipse based product as SWTBot test (Run As... JUnit Plugin
> Test). First the test trues to close the welcome view. E.g.
>
> @BeforeClass
> public static void beforeClass() throws Exception {
> bot = new SWTWorkbenchBot();
> bot.viewByTitle("Welcome").close();
> }
>
> However, the view is not really close. Repeating the close command would
> lead to an exception (view not found anymore). Since the view is not
> really closed, all succeeding tests fail of course.
>
> Do I miss anything? I already played around with bot.sleep but that did
> not help. Any ideas?
>
> Cheers,
> Jens

Hi Jens

I had the same problem as well in the past; I saw in other projects that
the closing of the welcome view is put in a try catch and the widget not
found exception is ignored (but that requires waiting for the timeout).

In my projects' swtbot tests, I prefer to close the welcome view
programmatically (not with SWTBot specific methods), see for example
closeWelcomeView here:

https://github.com/LorenzoBettini/xsemantics/blob/master/tests/it.xsemantics.tests.swtbot/src/it/xsemantics/tests/swtbot/XsemanticsSwtbotTestBase.java

hope this helps
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Previous Topic:SWTBot Figurecanvas use
Next Topic:running swtbot on linux luna
Goto Forum:
  


Current Time: Tue May 13 07:46:23 EDT 2025

Powered by FUDForum. Page generated in 0.02519 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top