Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

SWTBot/Snippets

< 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));
table.select("Debug");
 
SWTBotButton OkButton = new SWTBotButton((Button) bot.widget(widgetOfType(Button.class), openPerspectiveShell.widget));
OkButton.click();

Copyright © Eclipse Foundation, Inc. All Rights Reserved.