Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Widgets on CTabItem(Q: How do I find widgets on a CTabItem?)
Widgets on CTabItem [message #989157] Tue, 04 December 2012 22:09 Go to next message
Jim Klo is currently offline Jim KloFriend
Messages: 46
Registered: September 2012

I'm trying to locate widgets on a CTabItem within an RCP application.

2 things I need to check are:

1. contents of a label that appears on the CTabItem.
2. contents of a tree that also appears on the CTabItem.

I'm having problems trying to locate the widgets:

I've tried this:

		SWTBotView view = bot.viewById("QueryView");
		SWTBotCTabItem item =;
		Matcher<Widget> m = allOf(widgetOfType(Text.class), withLabel("Query:"));

		SWTBotText bot_text =, item.widget);

Basically it gets to the last line, and when it hits call to, item.widget)
it throws the WidgetNotFoundException.

Any advice would be greatly appreciated.

[Updated on: Tue, 04 December 2012 22:11]

Report message to a moderator

Re: Widgets on CTabItem [message #989711 is a reply to message #989157] Fri, 07 December 2012 11:29 Go to previous message
Mickael Istria, away until January 8th is currently offline Mickael Istria, away until January 8thFriend
Messages: 828
Registered: July 2009
Location: Grenoble, France
Senior Member

Maybe it's an issue with activation/focus. Add this:

> SWTBotView view = bot.viewById("QueryView");
> SWTBotCTabItem item =;
> ot item.setFocus()

> @SuppressWarnings("unchecked")
> Matcher<Widget> m = allOf(widgetOfType(Text.class),
> withLabel("Query:"));


Mickael Istria
JBoss, by Red Hat
My blog:
My Tweets:
Previous Topic:Unable to change perspective using SWTbot and Juno
Next Topic:'Click' at given coordinates inside a RCP View
Goto Forum:

Current Time: Sun Jun 24 22:59:51 GMT 2018

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

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

Back to the top