'Click' at given coordinates inside a RCP View [message #990016] |
Mon, 10 December 2012 13:53 |
Bernard Sarter Messages: 88 Registered: August 2011 Location: Paris, France |
Member |
|
|
Hello,
I'm fully new to SWTBot, so sorry in case my question is too 'simple' ...
I have an Eclipse RCP app, and I have a view 'V', inside a perspective 'P'.
This view mainly displays a fixed background image, and reacts if the user clicks at some given places, by checking the coordinates passed through the mouseDown method.
I'd like to write a test for that, using SWTBot, but I don't know how I could send a 'click' event directly at some coordinate X,Y of my view.
Any suggestions welcome ...
Thanks & best regards,
Bernard.
|
|
|
Re: 'Click' at given coordinates inside a RCP View [message #990192 is a reply to message #990016] |
Tue, 11 December 2012 10:55 |
|
On 12/10/2012 02:53 PM, Bernard SARTER wrote:
> Hello,
Hi,
> This view mainly displays a fixed background image, and reacts if the
> user clicks at some given places, by checking the coordinates passed
> through the mouseDown method.
>
> I'd like to write a test for that, using SWTBot, but I don't know how I
> could send a 'click' event directly at some coordinate X,Y of my view.
This is quite a low-level operation. SWTBot is good at manipulating SWT
and Eclipse widgets and concepts.
I think the best way to achieve what you want is directly to send an SWT
Event to this Image.
Display.asynExec(new Runnable() {
void run() {
widget.notifyListener(new Event(SWT.MouseDown...);
widget.notifyListener(new Event(SWT.MouseUp...);
}
}
HTH
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
|
|
|
Powered by
FUDForum. Page generated in 0.03648 seconds