Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » view not really closing
view not really closing [message #1611967] Wed, 11 February 2015 18:41 Go to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 313
Registered: July 2009
Senior Member
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 11:24 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
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: Fri Apr 26 07:44:43 GMT 2024

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

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

Back to the top