Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Null control ids in SWTBot(SWT Bot couldn't found control by ID in custom composite)
Null control ids in SWTBot [message #991087] Mon, 17 December 2012 10:36 Go to next message
Rom A is currently offline Rom A
Messages: 2
Registered: December 2012
Junior Member
One page in my RCP application contains custom composite

public class LocationComposite extends Group {
...
}

And I have some controls in it.

When I test my application with SWTBot
I could find all controls in by their IDs
except situation when control belongs to this custom LocationComposite

Within LocationComposite I have for example:

сheckBox = new Button(this, SWT.CHECK);
сheckBox.setData("ID", "сheckBox");
//сheckBox.setData("id", "сheckBox"); also the same result
сheckBox.setToolTipText("tooltip");

And in Tests:

SWTWorkbenchBot bot = new SWTWorkbenchBot();
...
//then find view, contains LocationComposite and in this wiew:

bot.checkBox().click(); //this works!
bot.checkBoxWithTooltip("tooltip"); //this also works!

bot.checkBox().getId(); //returns null
bot.checkBoxWithId("checkBox");// throws org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException

Re: Null control ids in SWTBot [message #991152 is a reply to message #991087] Mon, 17 December 2012 14:35 Go to previous message
Rom A is currently offline Rom A
Messages: 2
Registered: December 2012
Junior Member
I changed SWTBotPreferences.DEFAULT_KEY value
from "org.eclipse.swtbot.widget.key" to "ID".

So it works now, I think - resolved.
Previous Topic:Running SWTBot with RCP4.2
Next Topic:"Widget is disposed" when TreeColumnLayout is running
Goto Forum:
  


Current Time: Sat Sep 20 20:03:12 GMT 2014

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

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