Skip to main content



      Home
Home » Eclipse Projects » SWTBot » How to handle unpredictable shells
How to handle unpredictable shells [message #1413238] Thu, 28 August 2014 02:03 Go to next message
Eclipse UserFriend
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 05:23 Go to previous messageGo to next message
Eclipse UserFriend
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 06:43 Go to previous message
Eclipse UserFriend
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 23 11:59:33 EDT 2025

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

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

Back to the top