Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot cannot find pop up message box
SWTBot cannot find pop up message box [message #837688] Fri, 06 April 2012 01:08 Go to next message
Lia Gao is currently offline Lia GaoFriend
Messages: 2
Registered: March 2012
Junior Member

I tried to write an automation test to create a simple J2EE app. However, after I clicked "Finish". A "Open Associated Perspective" message box always popped up. I tried to close it using code below:

String oap ="Open Associated Perspective?";
for (SWTBotShell shell : bot.shells()) {
if (shell.getText().equals(oap)) {
bot.checkBoxWithLabel("Remember my decision").click();
}catch(WidgetNotFoundException e){
fail("cannot find open associated perspective?"); //for test purpose

And it always fail because it cannot find the message box. Actually, I did see the box popped up. Why SWTBot cannot find this shell?

Re: SWTBot cannot find pop up message box [message #887215 is a reply to message #837688] Sat, 16 June 2012 08:02 Go to previous message
Timur Achmetow is currently offline Timur AchmetowFriend
Messages: 38
Registered: April 2012
Is the message box native SWT? I ask, because SWTBot can't handle native SWT dialogs like message boxes or file dialogs.
Suggestion: work in your application code with (JFace) MessageDialog.openInformation(....) and not nativ SWT dialogs.
This works fine with SWTBot.
Previous Topic:Exception in thread "WorkbenchTestable"
Next Topic:How to add external jar file into Plug-in Dependencies hierarchy under SWTBot Test Plug-in project
Goto Forum:

Current Time: Sat Jun 23 20:08:18 GMT 2018

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

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

Back to the top