dimanche 26 avril 2015

SWTBot eclipse - How to terminate (stop project) a running project

I'm trying to stop a running project using SWTBot plug-in (for Automation testing). I've tried to terminate the project with the following command:

bot.toolbarButtonWithTooltip("Terminate").click();

but it doesn't work! also, I thought the problem is with element Focus issue, I fixed that with:

// Go to Console window (focus)
KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.ALT,Keystrokes.SHIFT,KeyStroke.getInstance(0, 'Q'));
bot.sleep(100);
KeyboardFactory.getAWTKeyboard().pressShortcut(KeyStroke.getInstance(0, 'C'));
bot.sleep(3000);
// TODO: try to terminate project
bot.toolbarButtonWithTooltip("Terminate").click();

but still it doesn't work!!

I also tried to use bot.Button() instead of toolbarButtonWithTooltip(), and also it doesn't work...

Thanks

Aucun commentaire:

Enregistrer un commentaire