Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » different behaviour running in pde and headless (context menus)
different behaviour running in pde and headless (context menus) [message #660334] Fri, 18 March 2011 00:07 Go to next message
Pete MacLiesh is currently offline Pete MacLiesh
Messages: 14
Registered: July 2009
Junior Member
Given that i can run a tiny set of tests in the pde, and can build, install and run exactly the same set of tests headless, is it expected that there are any differences in behaviour?

Specifically, i have a view that has dynamically constructed context menus. In the PDE i can run the test and it can select items on the context menu reliably (well as far as i have gotten anyway). When i run headless, the context menu (first level) is located, but then fails on click because it's already disposed. This is same code, same test.

Other bits of the same test that click on things in dialogs and editors work fine (headless and pde), and context menu items of a different tree view (project explorer) seem to be selectable ok headless.

So ... something in this view is tripping swtbots ability to click, but only when run headless.

Any thoughts as to what might cause that? Or what i can tweak to make it happy?

Here are the last few trace events that i see as swtbot processes this java:

t.expandNode("Configurations").getNode("Uninstalled Configs").getNode("nobuild").contextMenu("Delete").click();

SWTBotTree - (SWTBotTree.java:309) - Expanding nodes Configurations in tree (of type 'Tree' and with tooltip 'SysOverviewTree')
SWTBotTreeItem - (SWTBotTreeItem.java:169) - Tree item TreeItem with text {TreeItem {Configurations}} is already expanded. Won't expand it again.
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseEnter [6]: MouseEvent{Tree {} time=-969629777 data=null button=0 stateMask=0 x=0 y=0 count=0} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseMove [5]: MouseEvent{Tree {} time=-969629761 data=null button=0 stateMask=0 x=0 y=0 count=0} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event Activate [26]: ShellEvent{Tree {} time=-969629761 data=null doit=true} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event FocusIn [15]: FocusEvent{Tree {} time=-969629761 data=null} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseDown [3]: MouseEvent{Tree {} time=-969629761 data=null button=0 stateMask=0 x=0 y=0 count=0} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event Selection [13]: SelectionEvent{Tree {} time=-969629761 data=null item=TreeItem {nobuild} detail=0 x=0 y=0 width=0 height=0 stateMask=0 text=null doit=true} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseUp [4]: MouseEvent{Tree {} time=-969629761 data=null button=0 stateMask=0 x=0 y=0 count=0} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseHover [32]: MouseEvent{Tree {} time=-969629761 data=null button=0 stateMask=0 x=0 y=0 count=0} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseMove [5]: MouseEvent{Tree {} time=-969629745 data=null button=0 stateMask=0 x=0 y=0 count=0} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseExit [7]: MouseEvent{Tree {} time=-969629745 data=null button=0 stateMask=0 x=0 y=0 count=0} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event Deactivate [27]: ShellEvent{Tree {} time=-969629745 data=null doit=true} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event FocusOut [16]: FocusEvent{Tree {} time=-969629745 data=null} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseDown [3]: MouseEvent{TreeItem {nobuild} time=-969629745 data=null button=3 stateMask=0 x=0 y=0 count=1} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MouseUp [4]: MouseEvent{TreeItem {nobuild} time=-969629745 data=null button=3 stateMask=0 x=0 y=0 count=1} to Tree node with text: nobuild
SWTBotTreeItem - (AbstractSWTBot$2.java:160) - Sent event MenuDetect [35]: Event {type=35 Tree {} time=-969629730 data=null x=0 y=0 width=0 height=0 detail=0} to Tree node with text: nobuild

and then it barfs with:

org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundExcep tion: The widget {(of type 'MenuItem' and with mnemonic 'Delete')} was disposed.
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.<init>(AbstractSWTBot.java:106)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.<init>(SWTBotMenu.java:42)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.context Menu(AbstractSWTBot.java:460)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.context Menu(SWTBotTreeItem.java:528)

This is eclipse 3.7m5 and swtbot 2.0.4 on windows7

THANKS

PMac
Re: different behaviour running in pde and headless (context menus) [message #660617 is a reply to message #660334] Sun, 20 March 2011 00:25 Go to previous messageGo to next message
Pete MacLiesh is currently offline Pete MacLiesh
Messages: 14
Registered: July 2009
Junior Member
I tried dropping in Mariot Chauvin's alternate tree item context menu code (https://bugs.eclipse.org/bugs/show_bug.cgi?id=338555) and at first blush that seems to work.

I'll push it futher and see where i get.

Thanks Mariot

PMac
Re: different behaviour running in pde and headless (context menus) [message #660681 is a reply to message #660617] Mon, 21 March 2011 05:38 Go to previous message
Mariot Chauvin is currently offline Mariot Chauvin
Messages: 174
Registered: July 2009
Senior Member
Hi Pete,

That's cool if it solves your problem :).
Keep us informed.

Cheers,

Mariot
Le 20/03/2011 01:25, Pete MacLiesh a écrit :
> I tried dropping in Mariot Chauvin's alternate tree item context menu
> code (https://bugs.eclipse.org/bugs/show_bug.cgi?id=338555) and at first
> blush that seems to work.
>
> I'll push it futher and see where i get.
>
> Thanks Mariot
>
> PMac
>


--
Mariot Chauvin @ Obeo

Blog : http://mariot-thoughts.blogspot.com
Twitter :http://twitter.com/mchv
Professional support : http://obeo.fr/pages/maintenance-and-support/
Previous Topic:Running SWTbot test from Java Program
Next Topic:SSWT - how to change tooltip font for a toolbar object
Goto Forum:
  


Current Time: Tue Sep 16 04:54:57 GMT 2014

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

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