Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Problem with CommandFinder...(Trying to call a command, but it doesn't work...)
Problem with CommandFinder... [message #526828] Tue, 13 April 2010 07:54 Go to next message
Patrick is currently offline Patrick
Messages: 48
Registered: July 2009
Member
and I'm not sure why...

Hello Everbody! I'm trying to make my first steps with SWTBot. I'm trying to test an Eclipse RCP Application.

In one test i'm trying to call a command to save a dirty editor. But an assertion after the call, tells me that the editor is still dirty. An the data in the dirty editor is not showing up in the database.

On the other hand, i'm not getting an Exception when calling the command...

new CommandFinder().findCommand(CoreMatchers.equalTo(COMMANDNAME_SAVE)).get(0).click();


Has anyone any insperation for me, where i made a mistake?

[Updated on: Tue, 13 April 2010 07:57]

Report message to a moderator

Re: Problem with CommandFinder... [message #526880 is a reply to message #526828] Tue, 13 April 2010 11:46 Go to previous messageGo to next message
Ralf Ebert is currently offline Ralf Ebert
Messages: 168
Registered: July 2009
Senior Member
Hi Patrick,

> new
> CommandFinder().findCommand(CoreMatchers.equalTo(COMMANDNAME _SAVE)).get(0).click();

check if the editor save method is actually called. If the command would not have been
found, you would get a NPE; only thing that can go wrong IMHO is that the command is
disabled at that point in time. This might be the case if the window is not focused.
Turning on SWTBot logging might also help to spot the problem:

http://wiki.eclipse.org/SWTBot/FAQ#How_do_I_configure_log4j_ to_turn_on_logging_for_SWTBot.3F

Greetings,

Ralf


--
Read my Blog here: http://www.ralfebert.de/blog/
Follow me on Twitter here: http://twitter.com/ralfebert/
Re: Problem with CommandFinder... [message #527115 is a reply to message #526828] Wed, 14 April 2010 07:22 Go to previous message
Patrick is currently offline Patrick
Messages: 48
Registered: July 2009
Member
Thanks for the reply. I will try the logging first and post here what i discovered. Smile
Previous Topic:CTRL+mouseClick
Next Topic:TestSuite execution problem
Goto Forum:
  


Current Time: Thu Oct 02 00:33:58 GMT 2014

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

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