Skip to main content



      Home
Home » Eclipse Projects » SWTBot » Kind of events used in SWTBot
Kind of events used in SWTBot [message #32394] Thu, 16 April 2009 04:24 Go to next message
Eclipse UserFriend
I am no event expert, so I have some questions.

In your EclipseCon 2009 materials you wrote SWTBot uses simulated events,
not real ones.

1. Can you please explain why the events are only simulated and not real?

2. And you wrote that you might use real events in future in SWTBot. Why?
What would be the advantage? Are there any disadvantages of real events
compared to simulated ones?

3. It seems that here and there SWTBot does not realistically use events
compared to a human using the GUI. For example it is possible in SWTBot to
select the tree item in the Package Explorer view, but the view has no
focus after that event, which can never happen if a user selects a tree
item in a view. Would that be solved with "real" events?
Re: Kind of events used in SWTBot [message #32429 is a reply to message #32394] Thu, 16 April 2009 05:09 Go to previous messageGo to next message
Eclipse UserFriend
The great Morphious once said: What is "real"? How do you define "real"?
If you're talking about what you can feel, what you can smell, what you
can taste and see, then "real" is simply electrical signals interpreted
by your brain...

SWTBot feeds fake events to the event listeners to make your application
think it came from a real human being clicking on the UI.

The side-effects of this are that since swtbot just 'pumps' events, if a
verifylistener does not want to let this event go through by setting
event.doIt = false, swtbot does not understand this.

The other side-effect is what you mention in point 3 below, and swtbot
tries to mitigate this by doing a setFocus() before performing any
operations on the widget.

Sending real events would mean that swtbot does exactly what the user
does, the click is real flesh and meat and not mere electrical signals.

-- Ketan

On 16/4/09 13:54, Hans Schwaebli wrote:
> I am no event expert, so I have some questions.
>
> In your EclipseCon 2009 materials you wrote SWTBot uses simulated
> events, not real ones.
>
> 1. Can you please explain why the events are only simulated and not real?
>
> 2. And you wrote that you might use real events in future in SWTBot.
> Why? What would be the advantage? Are there any disadvantages of real
> events compared to simulated ones?
>
> 3. It seems that here and there SWTBot does not realistically use events
> compared to a human using the GUI. For example it is possible in SWTBot
> to select the tree item in the Package Explorer view, but the view has
> no focus after that event, which can never happen if a user selects a
> tree item in a view. Would that be solved with "real" events?
>
Re: Kind of events used in SWTBot [message #32464 is a reply to message #32429] Thu, 16 April 2009 05:56 Go to previous message
Eclipse UserFriend
Thank you for your information.

Can you please tell how exactly a real event would be fired?

I suppose you would then not use this anymore:
widget.notifyListeners(eventType, createEvent);

But what statment(s) else for real events?

And would a click on a button consist of many real events like it consists
of many simulated events currently:

notify(SWT.MouseEnter);
notify(SWT.MouseMove);
notify(SWT.Activate);
notify(SWT.FocusIn);
notify(SWT.MouseDown);
notify(SWT.MouseUp);
notify(SWT.Selection);
notify(SWT.MouseHover);
notify(SWT.MouseMove);
notify(SWT.MouseExit);
notify(SWT.Deactivate);
notify(SWT.FocusOut);
Previous Topic:Running tests on multiple client instances?
Next Topic:Are Dialog and ExpandBar supported?
Goto Forum:
  


Current Time: Fri Jun 13 13:30:43 EDT 2025

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

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

Back to the top