Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Keystrokes on SWTBotShell(Keystorkes are not working as expected for me)
Keystrokes on SWTBotShell [message #720716] Wed, 31 August 2011 06:30
Leela  is currently offline Leela Friend
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
Previous Topic:Problem with auto-complete in eclipse
Next Topic:How to determine button is available or not
Goto Forum:
  


Current Time: Tue Apr 16 19:23:45 GMT 2024

Powered by FUDForum. Page generated in 1.54325 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top