Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot seems not to find a combo box in the toolbar.
SWTBot seems not to find a combo box in the toolbar. [message #697096] Fri, 15 July 2011 14:10 Go to next message
Norbert is currently offline NorbertFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,

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 ?

Thank you,
Norbert
Re: SWTBot seems not to find a combo box in the toolbar. [message #698718 is a reply to message #697096] Wed, 20 July 2011 04:46 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Do you have a screenshot that you could share?

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot | @ketanpkr

On 7/15/11 7:10 AM, Norbert wrote:
> Hi,
>
> 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 ?
>
> Thank you,
> Norbert
>
>
Re: SWTBot seems not to find a combo box in the toolbar. [message #699411 is a reply to message #698718] Thu, 21 July 2011 14:05 Go to previous messageGo to next message
Norbert is currently offline NorbertFriend
Messages: 8
Registered: July 2009
Junior Member
Am 20.07.2011 06:46, schrieb Ketan Padegaonkar:
> Do you have a screenshot that you could share?
>
Hello Mr. Ketan Padegaonkar,

attached is my screenshot.

Here is my code snippet:
bot = new SWTWorkbenchBot();
viewBot = bot.viewById(View.ID);
viewBot.setFocus();

SWTBotCombo combo = bot.comboBoxWithId("name", "myComboBox");
combo.setSelection(1);

At comboBoxWithId() IO get the WidgetNotDoundException.

Sincerely,
Norbert Gutknecht
Re: SWTBot seems not to find a combo box in the toolbar. [message #702697 is a reply to message #699411] Tue, 26 July 2011 17:16 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
On 7/21/11 7:05 AM, Norbert wrote:
> Am 20.07.2011 06:46, schrieb Ketan Padegaonkar:
>> Do you have a screenshot that you could share?
>>
> Hello Mr. Ketan Padegaonkar,
>
> attached is my screenshot.
>
> Here is my code snippet:
> bot = new SWTWorkbenchBot();
> viewBot = bot.viewById(View.ID);
> viewBot.setFocus();
>
> SWTBotCombo combo = bot.comboBoxWithId("name", "myComboBox");
> combo.setSelection(1);
>
> At comboBoxWithId() IO get the WidgetNotDoundException.
>
> Sincerely,
> Norbert Gutknecht

I think we're likely not searching for dropdowns in the location you
describe. Could you create a bug and attach a small snippet that can
create the combo box in a simple view?

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot | @ketanpkr
Re: SWTBot seems not to find a combo box in the toolbar. [message #704819 is a reply to message #702697] Fri, 29 July 2011 05:27 Go to previous messageGo to next message
Leela  is currently offline Leela Friend
Messages: 10
Registered: June 2010
Junior Member
Is this raised as bug and fixed?? I am also looking for same. Can you please let me know the status?
Re: SWTBot seems not to find a combo box in the toolbar. [message #707959 is a reply to message #704819] Tue, 02 August 2011 09:11 Go to previous messageGo to next message
Norbert is currently offline NorbertFriend
Messages: 8
Registered: July 2009
Junior Member
Am 29.07.2011 07:27, schrieb Leela:
> Is this raised as bug and fixed?? I am also looking for same. Can you
> please let me know the status?
No, I did not raise that issue as a bug yet.
Re: SWTBot seems not to find a combo box in the toolbar. [message #722879 is a reply to message #707959] Wed, 07 September 2011 03:48 Go to previous messageGo to next message
Madhu G is currently offline Madhu GFriend
Messages: 8
Registered: September 2011
Junior Member
HI,

This issue has been reported.
Bug id=356883
Short text : "SWTBot seems not to find a combo box in the toolbar."

Even I'm waiting for this issue to be resolved

Regards,
Madhu
Re: SWTBot seems not to find a combo box in the toolbar. [message #756467 is a reply to message #722879] Sun, 13 November 2011 18:15 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Can someone provide me a bit more information on what I've asked on the
bugzilla(https://bugs.eclipse.org/bugs/show_bug.cgi?id=356883#c2)

- Ketan

On 9/6/11 8:48 PM, madhurg81 wrote:
> HI,
>
> This issue has been reported.
> Bug id=356883
> Short text : "SWTBot seems not to find a combo box in the toolbar."
>
> Even I'm waiting for this issue to be resolved
>
> Regards,
> Madhu
>
Re: SWTBot seems not to find a combo box in the toolbar. [message #756783 is a reply to message #756467] Tue, 15 November 2011 05:07 Go to previous message
Madhu G is currently offline Madhu GFriend
Messages: 8
Registered: September 2011
Junior Member
Hi ketan,

I have provided the details which you have asked for. I'm also providing the details though Norbert already provided in the thread.

I'm adding the snapshot of combo box zoom control on the tool bar.
index.php/fa/6140/0/

Eclipse spy view details:

Location:
//Shell/-1//CBanner/0//Composite/0//CoolBar/0//ToolBar/11//Combo/0

Layout Information:
Combo {100%}
Style: DROP_DOWN | READ_ONLY | HORIZONTAL | LEFT_TO_RIGHT
Layout Data: null
Bounds: Rectangle {46, 0, 75, 23}


Children: 0

Siblings: 1
[*]Combo {100%}: 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

Thanks & regards,
Madhu
Previous Topic:how to capture the coolitem click on editor
Next Topic:Twistie - Control.
Goto Forum:
  


Current Time: Thu Apr 25 13:14:51 GMT 2024

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

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

Back to the top