Skip to main content



      Home
Home » Eclipse Projects » SWTBot » How to click on Message dilogue "OK" Button (At the Time of Saving content Message Dilogue appears with OK and Cancel,I want to click on OK button.please reply)
How to click on Message dilogue "OK" Button [message #1730115] Thu, 21 April 2016 08:35 Go to next message
Eclipse UserFriend
At the Time of Saving my content, Message Dilogue appears with OK and Cancel,I want to click on OK button By Using SWTBot

[Updated on: Thu, 21 April 2016 08:37] by Moderator

Re: How to click on Message dilogue "OK" Button [message #1730134 is a reply to message #1730115] Thu, 21 April 2016 12:00 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sumit,

It should work with something like this:

SWTWorkbenchBot bot = new SWTWorkbenchBot();
SWTBotShell shell = bot.shell("Dialog Title");
SWTBot shellBot = shell.bot();
SWTBotButton button = shellBot.button("OK");
button.click();


Patrick
Re: How to click on Message dilogue "OK" Button [message #1730140 is a reply to message #1730134] Thu, 21 April 2016 13:00 Go to previous messageGo to next message
Eclipse UserFriend
Well, unless your message dialog is a native dialog (e.g. FileDialog, DirectoryDialog, MessageBox).

In that case, native dialogs are not yet supported in SWTBot and there is nothing you can do that doesn't involve modifying the application under test.

See http://wiki.eclipse.org/SWTBot/FAQ#How_do_I_use_SWTBot_to_test_native_dialogs_.28File_Dialogs.2C_Color_Dialogs.2C_etc.29.3F
Re: How to click on Message dilogue "OK" Button [message #1730329 is a reply to message #1730140] Sun, 24 April 2016 22:52 Go to previous messageGo to next message
Eclipse UserFriend
Thank You for reply but it dosent work in my case,it throws below error

Could not find shell matching: with text 'Save Status'
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:398)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:372)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:360)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:346)
... 31 more
Re: How to click on Message dilogue "OK" Button [message #1730817 is a reply to message #1730329] Thu, 28 April 2016 12:48 Go to previous message
Eclipse UserFriend
Hi Sumit,

If you look at the code of your application under test, how is it creating the "Save Status" dialog? Which class is this dialog?
Previous Topic:Nebula NatTable is now supported
Next Topic:Replacement for deprecated SWTBotView.menus method?
Goto Forum:
  


Current Time: Wed May 21 09:59:42 EDT 2025

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

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

Back to the top