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: 40
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 is currently offline Mickael IstriaFriend
Messages: 813
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: Fri Oct 28 06:46:39 GMT 2016

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

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