Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot with tycho - no context menu(Works under SWTBot launch config but not under maven.)
icon5.gif  SWTBot with tycho - no context menu [message #841587] Wed, 11 April 2012 14:01 Go to next message
Craig Foote is currently offline Craig FooteFriend
Messages: 217
Registered: July 2009
Senior Member
I'm having trouble running an SWTBot TestCase under maven and tycho. The following code checks for a context menu item which works when running the test in my IDE but not when I run it using maven.
SWTBotTableItem item = view.bot().table().getTableItem("a");
item.select();
item.contextMenu("b");


In my pom I'm specifying tycho 0.14.1 and swtbot 2.0.0. It specifies the following configuration for the tycho-surefire-plugin:

<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>


I have my indirect dependencies listed as well. I've added debugging statements to the test method and verified the plugins that should be active are and that the current selection is correct. Just no context menu.

What could I be doing wrong?

Craig
Re: SWTBot with tycho - no context menu [message #1061115 is a reply to message #841587] Thu, 30 May 2013 06:21 Go to previous messageGo to next message
Peter Kullmann is currently offline Peter KullmannFriend
Messages: 240
Registered: July 2009
Senior Member
Craig, have you found a solution? I'm having the same problem. When I execute the tests with tycho there are no context menu entries visible to SWTBot. When I debug (surefire debugPort option) I can interact with the rcp under test and I can see that the context menu entries are visible - but for SWTBot the expression "part.pane.menuManager.items" returns 0 elements. Running the tests directly from the ide is working. BTW in my case I'm using eclipse 3.7.2 and not e4.

Regards,
Peter
Re: SWTBot with tycho - no context menu [message #1061142 is a reply to message #1061115] Thu, 30 May 2013 08:20 Go to previous message
Peter Kullmann is currently offline Peter KullmannFriend
Messages: 240
Registered: July 2009
Senior Member
I have found the solution for my own problem. I had the following code that worked in the ide and did not with tycho:

view.menu("Drucken").click();


Diving deeper into the SWTBot Code (2.0.5) one sees that if SWTBot doesn't find any menu entries (which it doesn't) it searches the command service for a command with this label. My menu entry was "Drucken" but the command was org.eclipse.ui.file.print - associated with the english text. As soon as I added org.eclipse.ui.nl_de to the test runtime everything worked well.

Peter
Previous Topic:No Classloader found for plug-in org.eclipse.jdt.junit4.runtime
Next Topic:Swtbot still depends on org.junit4?
Goto Forum:
  


Current Time: Thu Apr 25 19:54:48 GMT 2024

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

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

Back to the top