|
Re: Key Press: Enter [message #45062 is a reply to message #45050] |
Thu, 23 July 2009 04:18 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
Keystrokes.CR and Keystrokes.LF is what you're looking for.
Some more keystrokes here:
http://github.com/ketan/swtbot/blob/9f2a3beb6dc00e8827fe127e ec589a80bcdfe6b6/org.eclipse.swtbot.swt.finder/src/org/eclip se/swtbot/swt/finder/keyboard/Keystrokes.java
--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
On 23/7/09 05:29, Michael Wiederhold wrote:
> Ketan,
>
> I have been writing a test case with SWTBot and one of the requirements
> is to type a keyboard shortcut CTRL + SHFT + Enter. I can successfully
> press the first two keys, but am unable to press the Enter key because
> in the SWT class there is not equivalent for SWT.ENTER. Below are a few
> lines of code I have written. Any Suggestions on how I can test the
> pressing of the Enter key?
> KeyStroke ctrl = KeyStroke.getInstance(SWT.CTRL, 0);
> KeyStroke shift = KeyStroke.getInstance(SWT.SHIFT, 0);
> //KeyStroke ret = KeyStroke.getInstance(0, SWT.???);
> bot.sleep(2000);
> //k.pressShortcut(ctrl, shift, ret);
>
> Thanks,
> Mike
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03301 seconds