Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Unable to instantiate SWTWorkbenchBot in Eclipse E4
Unable to instantiate SWTWorkbenchBot in Eclipse E4 [message #1512091] Mon, 15 December 2014 12:46 Go to next message
Loic Faure is currently offline Loic FaureFriend
Messages: 24
Registered: December 2014
Junior Member
Hi,

I want to test Eclipse RCP 4 application which I currently migrate from Eclipse RCP 3. I use SWTBot plugin. I have to use SWTWorkbenchBot for setting perspective which is in the plugin org.eclipse.swtbot.e4.finder. Before using this class, I used the same class but for Eclipse 3 which is in the plugin org.eclipse.swtbot.eclipse.finder.

But I can't initialize by injection the IEclipseContext attribute of the SWTWorkbenchBot. So are there a method for doing it?

Or maybe, there is a way for testing Eclipse 4 RCP applications with org.eclipse.swtbot.eclipse ?

Thanks in advance,
Loic
Re: Unable to instantiate SWTWorkbenchBot in Eclipse E4 [message #1513369 is a reply to message #1512091] Tue, 16 December 2014 13:15 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 865
Registered: July 2009
Location: Grenoble, France
Senior Member

How do you run your test?
--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: Unable to instantiate SWTWorkbenchBot in Eclipse E4 [message #1591190 is a reply to message #1513369] Thu, 29 January 2015 11:22 Go to previous messageGo to next message
Matt Biggs is currently offline Matt BiggsFriend
Messages: 71
Registered: July 2009
Member
Bit of a late response, but we use this in all our test classes where Activator.class is the Activator of your plugin being tested.


	protected static IEclipseContext getEclipseContext() {
		final IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(Activator.class).getBundleContext());
		return serviceContext.get(IWorkbench.class).getApplication().getContext();
	}
Re: Unable to instantiate SWTWorkbenchBot in Eclipse E4 [message #1690989 is a reply to message #1591190] Wed, 01 April 2015 12:55 Go to previous message
Loic Faure is currently offline Loic FaureFriend
Messages: 24
Registered: December 2014
Junior Member
Sorry for the very late response, i was not notified when you repsonded and I resolved the problem by updating some of the tests which were on eclipse 3.x style and that worked.
Thanks for the answers, I will use what you said Matt when I will not be able to continue testing with swtbot 3x.
Previous Topic:Robotframework tool using SWTBot
Next Topic:Assert the text inside the MessageDialog
Goto Forum:
  


Current Time: Thu Apr 25 10:41:40 GMT 2024

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

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

Back to the top