Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Clicking Source, Design tabs for XML files(Clicking Source, Design tabs for XML files)
Clicking Source, Design tabs for XML files [message #1111030] Tue, 17 September 2013 17:12 Go to next message
John Stashkevetch is currently offline John StashkevetchFriend
Messages: 1
Registered: September 2013
Junior Member

I've been trying to find a way to get a handle on the 'Source' and 'Design' tabs in the active editor.

SWTBot test recorder does not seem to be aware of this behavior and I haven't been able to find any information about this.

Does anyone have an idea whether this behavior is automatable?

Re: Clicking Source, Design tabs for XML files [message #1111472 is a reply to message #1111030] Wed, 18 September 2013 09:05 Go to previous messageGo to next message
Benjamin Ratiarisolo is currently offline Benjamin RatiarisoloFriend
Messages: 16
Registered: January 2010
Location: Paris, France
Junior Member
Hi John,

You could try something like:

   // ...
   SWTWorkbenchBot bot = ...;
   Matcher<IEditorReference> withPartName = withPartName("test.xml");
   WaitForEditor waitForEditor = waitForEditor(withPartName);
   SWTBotMultiPageEditor swtBotEditor = new SWTBotMultiPageEditor(waitForEditor.get(0), bot);
   SWTBotCTabItem swtBotCTabItem = editor.activatePage("Source");
   // Now your 'Source' editor tab should have the focus
   // You should be able to test its content as usual
   // ...

I test quite a lot of multi-page editors with a similar code.


Benjamin Ratiarisolo
IBM ODM Decision Server Rules - Software Developer
IBM Software - France Lab
Re: Clicking Source, Design tabs for XML files [message #1111476 is a reply to message #1111030] Wed, 18 September 2013 09:05 Go to previous message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 789
Registered: July 2009
Location: Grenoble, France
Senior Member
I'm not 100% sure, but it seems to me that a tabbed editor is actually a
single editor which contains a CTabFolder (or a TabFolder) as primary

So something like this should work:
SWTBotEditor editor = bot.editor("test.xml");;
// Or editor.tabItem("Source").click();

The generator is still young and misses some rule to support several
widgets, including TabItem and CTabItem. Feel free to contribute them as
explained in .
It's not difficult to add a rule and contribute, so don't hesitate !
Mickael Istria
My job:
My blog:
My Tweets:
Previous Topic:Finding difficult to select an context menu
Next Topic:hanging on new SWTWorkbenchBot()
Goto Forum:

Current Time: Tue Dec 01 00:24:43 GMT 2015

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

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