Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to handle unpredictable shells
How to handle unpredictable shells [message #1413238] Thu, 28 August 2014 06:03 Go to next message
Shwetali Dhumal is currently offline Shwetali DhumalFriend
Messages: 12
Registered: August 2014
Junior Member
Hi,

In my RCP Application, sometimes some shell are opening on some conditions and i want to handle them.
for example: Overwrite shell will open if file is already exist in folder.I want to work on Overwrite shell if it would open.

I have tried if condition with shell is active,see code. But if condition is not working in swtbot. It is trying to click on Ok button which is on Overwrite shell even if overwrite shell is not opening.

See code:

If(swtBot.shell("Overwrite").isActive){

swtBot.Button("Ok").click(); //This code is every time executing even if Overwrite shell is not opened.
}else{

//doing some other operation
}
Re: How to handle unpredictable shells [message #1414773 is a reply to message #1413238] Mon, 01 September 2014 09:23 Go to previous messageGo to next message
Aparajita K is currently offline Aparajita KFriend
Messages: 7
Registered: August 2014
Junior Member
Hi Shwetali,

You can try this,it can help you.

 try{
                swtBot.shell("Question").activate();
                robot.keyPress(VK_ENTER);
                }catch(WidgetNotFoundException e){
                        
                        System.out.println("Not found");
                }


Re: How to handle unpredictable shells [message #1421421 is a reply to message #1414773] Thu, 11 September 2014 10:43 Go to previous message
pawan garia is currently offline pawan gariaFriend
Messages: 39
Registered: February 2013
Member
If its not and SWT Dialog and if its a windows based dialog .

Swtbot will not be able to handle that you have to use AutoIT or Robot Class to click Enter.

Please attach Snapshot for more clear help.

Regards,
Pawan Garia
Previous Topic:Unable to identify/Click On Shell
Next Topic:How to select a TREE item in a TABLE?
Goto Forum:
  


Current Time: Wed Apr 24 13:58:51 GMT 2024

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

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

Back to the top