Jump to: navigation, search


< SWTBot
Revision as of 03:36, 10 January 2009 by Ketanpadegaonkar.gmail.com (Talk | contribs) (created a snippets page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Some snippets for working with SWTBot

Switch perspective

This allows you to switch perspectives in eclipse from within the Window>Open Perspective>Other... menu.

// Change the perspective via the Open Perspective dialog       
bot.menu("Window").menu("Open Perspective").menu("Other...").click();
SWTBotShell openPerspectiveShell = bot.shell("Open Perspective");
SWTBotTable table = new SWTBotTable((Table) bot.widget(widgetOfType(Table.class), openPerspectiveShell.widget));
SWTBotButton OkButton = new SWTBotButton((Button) bot.widget(widgetOfType(Button.class), openPerspectiveShell.widget));