ase you have two edit buttons in two different groups // say an edit button in the "Address" section, // and another in "Bank Account" section, you can do the following // to click on the "Edit" button on the "Bank Account" section. // This is the recommended way to use SWTBot, instead of finding widgets based on its index. bot.buttonInGroup("Edit", "Bank Account").click(); For finding widgets using custom matchers:
SWTBot bot = new SWTBot(); // // find a button within the currently active shell: // SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher)); // or SWTBotButton button = new SWTBotButton((Button)bot.widget(aMatcher, 3)); // for the 4th widget // // to find a button within a particular parent composite: // SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, parentComposite)); //or SWTBotButton button = new SWTBotButton((Button) bot.widget(aMatcher, parentComposite, 3)); //for the 4th widget
@version $Id$