문제

I'm trying to run SWTbot test case that uses keyboard short-cuts. I could not find any reference for how to do it.

I'm pretty sure that should not be that difficult. I'll appreciate it if someone can write a small snippet.

Thanks,

Ziv

도움이 되었습니까?

해결책

What about using the pressShortcut() methood?

For TreeItem:

final SWTBotTreeItem item = ...
item.select().pressShortcut(SWT.CTRL, 'F');

For TableItem:

final SWTBotTableItem item = ...
item.select().pressShortcut(SWT.CTRL, 'F');

For EclipseEditor

((SWTBotEclipseEditor)bot.activeEditor()).pressShortcut(SWT.CTRL, '1')

From Active Shell:

 bot.activeShell().pressShortcut(
        Keystrokes.CTRL, KeyStroke.getInstance("1"));

다른 팁

For multiple modifiers keys you can use

item.select().pressShortcut(SWT.CTRL | SWT.ALT, 'F');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top