Community
Participate
Working Groups
Build Identifier: 3.5.2 HI, The issue details are already posted in the eclipse forum : Please visit Forum : <http://www.eclipse.org/forums/index.php/mv/msg/220874/697096/#msg_697096> Issue excerpt: I am trying to test an eclipse RCP application. I want SWTBot to click on an item of a combo box (drop down box), which is located in the toolbar of a view. This combo box is created in my class myOptionsCombo and contributed as control for a menuContribution ("toolbar:com...gui.myView (menuContribution)" ). In class myOptionsCombo, I called setToolTip() and setData() > Combo combo = new Combo(parent, SWT.DROP_DOWN); > combo.setToolTip("aToolTip"); > combo.setData("name", "myCombo"); > // adding my items... to get more options to find it with SWTBot. The toolbar contains other elements (toolbar buttons) which have been defined in code (no contributions). I am able to click these buttons. But accessing my combo box never worked so far: But when calling > SWTWorkbenBot bot = new SWTWorkbenBot(); > SWTBotView viewBot = bot.viewById("myView"); > viewBot.setFocus(); > viewBot.toolbarButton("Tooltip of a button").click(); // this worked > SWTBotCCombo combo = viewBot.bot().comboboxWithId ("name", "myCombo"); I get a WidgetNotFoundException. Can someone show me how to access the combo and click one of its items ? Best regards, Madhu Reproducible: Always Steps to Reproduce: 1.Assuming combo presents in the toolbar. 2.Not able to identify the widget using SWTBot toolbarDropDownButtonWithTooltip Details : <http://www.eclipse.org/forums/index.php/mv/msg/220874/697096/#msg_697096>
Created attachment 206902 [details] Dropdown in view
I've looked at this issue and I'm able to click on a drop down button inside the toolbar using the following api. bot.viewByTitle('Task List').toolbarDropDownButton('New Task').click() See the screenshot of which drop down I'm referring to. Do you have a screenshot of how your dropdown looks like and the output of the spy view when spying on your dropdown (http://wiki.eclipse.org/SWTBot/FAQ#Can_I_get_more_details_on_a_particular_widget.3F)
HI , I am attaching the combo box snapshot. Please have a look on this. Thanks & regards, Madhu
Created attachment 207001 [details] ZoomControlOntheToolBar Zoom Control Combo box on the tool bar.
(In reply to comment #4) > Created attachment 207001 [details] > ZoomControlOntheToolBar > > Zoom Control Combo box on the tool bar. Adding captured details by Spy view: To toggle, or freeze info on a particular control, press CTRL+SHIFT: Location: //Shell/-1//CBanner/0//Composite/0//CoolBar/0//ToolBar/11//Combo/0 Layout Information: Combo {150%} Style: DROP_DOWN | READ_ONLY | HORIZONTAL | LEFT_TO_RIGHT Layout Data: null Bounds: Rectangle {46, 0, 75, 23} Children: 0 Siblings: 1 [*]Combo {150%}: Layout Data: null Parent Tree: ToolBar {}[11]@ Layout: null LayoutData: null CoolBar {}[0]@ Layout: null LayoutData: null Composite {}[0]@ Layout: CacheWrapper$WrapperLayout LayoutData: CLayoutData CBanner {}[0]@ Layout: CBannerLayout LayoutData: WindowTrimProxy Shell {Business Blueprint -...}[-1]@ Layout: TrimLayout LayoutData: null
Just got bitten by this too. Note that Ketan's example above is using a drop-down button, which is not at all the same thing as a combo box attached to a separator. Looking in ToolbarResolver, I'm guessing getChildren might need to do getControl on each of the items and add any controls it finds to the list. I'm trying to access it by using the ControlFinder, which doesn't find it.
Hello, i had a similar problem: SWTBot did not find a Text control contribution added via the org.eclipse.ui.menus extension point to the main toolbar of an RCP application. After some debugging, i found that SWTBot is missing a suitable Resolver for ToolItems. I implemented the Resolver and modified the SWTBot finder to include it in it's search. I will attach a patch with the changes.
Created attachment 236370 [details] Added ToolItemResolver Added ToolItemResolver and modified finders so SWTBot finds control contributions added to the a RCP main or view toolbar via the org.eclipse.ui.main.toolbar extension point.
Thanks for this patch Marcel. Can you please ocntribute it using Gerrit as explained on http://wiki.eclipse.org/SWTBot/Contributing . It will make review easier.
Thanks @Marcel for contrib https://git.eclipse.org/r/#/c/17313/