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: 26
Registered: September 2012
Junior Member
Hi,

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 = view.bot().cTabItem();
		
		@SuppressWarnings("unchecked")
		Matcher<Widget> m = allOf(widgetOfType(Text.class), withLabel("Query:"));

		SWTBotText bot_text = view.bot().widget((Text)m, item.widget);


Basically it gets to the last line, and when it hits call to
view.bot().widget((Text)m, 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: 771
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 = view.bot().cTabItem();
>

item.click() ot item.setFocus()

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

item.text()

HTH
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Previous Topic:Unable to change perspective using SWTbot and Juno
Next Topic:'Click' at given coordinates inside a RCP View
Goto Forum:
  


Current Time: Thu Dec 18 23:12:25 GMT 2014

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

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