|SWTBot seems not to find a combo box in the toolbar. [message #697096]
||Fri, 15 July 2011 10:10
Registered: July 2009
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.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.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 ?
Powered by FUDForum
. Page generated in 0.04037 seconds