Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:35 Go to next message
Sumit Ganjale is currently offline Sumit GanjaleFriend
Messages: 7
Registered: April 2016
Junior Member
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 12:37]

Report message to a moderator

Re: How to click on Message dilogue "OK" Button [message #1730134 is a reply to message #1730115] Thu, 21 April 2016 16:00 Go to previous messageGo to next message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 56
Registered: July 2009
Member
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 17:00 Go to previous messageGo to next message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 56
Registered: July 2009
Member
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] Mon, 25 April 2016 02:52 Go to previous messageGo to next message
Sumit Ganjale is currently offline Sumit GanjaleFriend
Messages: 7
Registered: April 2016
Junior Member
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 16:48 Go to previous message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 56
Registered: July 2009
Member
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 Nov 14 10:50:28 GMT 2018

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

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

Back to the top