Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to wait for a MessageDialog to appear?
How to wait for a MessageDialog to appear? [message #30292] Wed, 25 March 2009 07:32 Go to next message
Anders Baumann is currently offline Anders Baumann
Messages: 55
Registered: July 2009
Member
Hello there!
How do I wait for a MessageDialog to appear? I just want to wait for it to
appear and then click on the "Ok" or "Cancel" button. At the moment I am
using the SWTBotFactory.sleep method, but that seems kind of random.

Thanks in advance,
Anders Baumann
Re: How to wait for a MessageDialog to appear? [message #30436 is a reply to message #30292] Wed, 25 March 2009 19:18 Go to previous message
Ketan Patel is currently offline Ketan Patel
Messages: 68
Registered: July 2009
Member
There are few options; you can wait for the shell
SWTBotShell shell = bot.shell("Title");

or you can use predefined conditions in Contditions class:
bot.waitUntil(Conditions.shellCloses(shell));

You can look at the SWTBot tests for examples. Here is one case which
deletes project, which waits for shell

http://github.com/ketan/swtbot/blob/ee2821dd5a298f8af2cd606c a80f69f05c99c346/org.eclipse.swtbot.eclipse.finder.test/src/ org/eclipse/swtbot/eclipse/finder/widgets/helpers/PackageExp lorerView.java
Previous Topic:EclipseCon 2009 tutorial update
Next Topic:Where to post bugs?
Goto Forum:
  


Current Time: Mon Jul 28 12:46:04 EDT 2014

Powered by FUDForum. Page generated in 0.02104 seconds