Keystrokes on SWTBotShell [message #720716] |
Wed, 31 August 2011 06:30 |
Leela Messages: 10 Registered: June 2010 |
Junior Member |
|
|
Hi,
We are working on Eclipse Plugin Applications. We have two buttons on Eclipse ToolBar aka Login and Logout. On clicking login button, it opens a shell to enter username and password.
When I run the following code I am facing some issues:
Quote:
public void loginBPD(String userName, String userPassword){
workBench.bot.toolbarButtonWithTooltip("Login").click();
SWTBotShell loginShell = EclipseHelper.bot.shell("Login");
loginShell.bot().text(0).setText(userName);
loginShell.bot().text(1).setText(userPassword);
//loginShell.bot().text(1).typeText("\n");
loginShell.bot().text(1).pressShortcut(0,SWT.CR);
workBench.bot.waitUntil(Conditions.shellCloses(loginShell));
}
public void logoutBPD() {
workBench.bot = new SWTWorkbenchBot();
workBench.bot.toolbarButtonWithTooltip("Logout").click();
}
@Test
public void testMe(){
loginBPD("leela","leela");
//Do something
logout();
loginBPD("xx",xx");
}
When I am running testMe() I am able to login and logout and for the next login() it is entering the values in the TEXT BOXES but not pressing the SHORTCUT ENTER. Its waiting in the same place. I cannot use button click as they are not buttons. I tried typetext("\n") also. This is also working only one time not from second time.
I am attaching a snapshot of login dailog also.
Can you please help me in this.....
Thanks,
Leela
|
|
|
Powered by
FUDForum. Page generated in 0.02675 seconds