Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Cant select contextMenu from own plugin
Cant select contextMenu from own plugin [message #42938] Fri, 10 July 2009 18:28 Go to next message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
Hi,

I want to test a plugin-project. This project adds a popupmenu to the
(any) src-folder.

Unfortunatly, I cant select it. My code:

@Test
public void simpleClassTest()
{
SWTBotView packExp = bot.viewByTitle("Package Explorer");
SWTBot packBot = packExp.bot();
SWTBotTree tree = packBot.tree().select("ObjTeamsProject");
SWTBotTreeItem prjTreeItem = tree.expandNode("ObjTeamsProject");
SWTBotTreeItem srcTree = prjTreeItem.select("src");
srcTree.setFocus();//test
srcTree.select();//test
srcTree.click();//test
srcTree.expand(); //test
bot.sleep(10000);
SWTBotMenu menu = srcTree.contextMenu("Obtero");
Assert.assertTrue(true);
}

The project and the src-folder exist (I use my own workspace and I dont
clean it).

The JUnit error is:
org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after:
5000 ms.: Could not find context menu with text: Obtero at ...

Additional infos:

1)
As I watch the test perform, I can see that the project gets highlighted
(i.e. focused). But the src-folder will only get focues for a partion of a
second and then the project will be focused again.

2)
The menu-item exists. While "bot.sleep(10000)" perfoms, I right-clicked
the src-folder and saw that it is there.

3)
It works with the "normal" menu-items. I tried it with "New" or "Team".

4)
It appears to use the contextmenu of the project and not the one of the
src-folder. I get this impression because:
While "bot.sleep(10000)" perfomed, I right-clicked on the src-folder. When
"bot.sleep(10000)" finished, the standard-context-menu appeared (when
SWTBot apparently tries to find the menu-item "Obtero"). If I now
right-click on the src-folder, while SWTBot tries to find the menu-item
"Obtero", it works! So obviously SWTBot is using the wrong context item. I
am suspecting that the reason is, that I can not focus the src-folder (you
see all the "//test" commented lines where I am trying to focus it).

So is it a bug, or am I doing something wrong?

thank you
Re: Cant select contextMenu from own plugin [message #42969 is a reply to message #42938] Fri, 10 July 2009 21:00 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
On 10/7/09 23:58, Usul wrote:

> So is it a bug, or am I doing something wrong?

Seems like a bug to me. Please file one, and I'll take a look at it.

--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
Re: Cant select contextMenu from own plugin [message #43069 is a reply to message #42969] Sat, 11 July 2009 09:11 Go to previous message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
OK: https://bugs.eclipse.org/bugs/show_bug.cgi?id=283219

I took some time and wrote how to reproduce the bug. Probably more
detailed then necessary.
Previous Topic:swtBotEclipseEditor.typeText issue
Next Topic:Custom Widgets
Goto Forum:
  


Current Time: Fri Apr 26 18:11:25 GMT 2024

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

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

Back to the top