Checking the enablement of Remove All Breakpoints button

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Checking the enablement of Remove All Breakpoints button

Postby jluebker » Tue Jul 07, 2009 8:36 am

Hello,

I created a utility method that attempts to remove all breakpoints in the Eclipse Breakpoints view. I ran into a problem where the utility was timing out when there were not breakpoints set in the system. So I attempted to update the utility to check the enabled state of the Remove All Breakpoints button before attempt to click it and wait for a dialog to be displayed. When I added the check of the enabled condition the button is no longer clicked. Is this a problem with testing the Condition returned from the isEnabled() method of a ContributedToolItemLocator?

Code: Select all
public static void removeAllBreakpoints(IUIContext ui) throws Exception {
      EclipseUtils.openViewByName("Breakpoints");
      ContributedToolItemLocator removeAllButtonLocator = new ContributedToolItemLocator("org.eclipse.debug.ui.breakpointsView.toolbar.removeAll");
      IUICondition enabledCondition = removeAllButtonLocator.isEnabled(true);

      if (enabledCondition.testUI(ui)) {
         ui.click(removeAllButtonLocator);
         ui.wait(new ShellShowingCondition("Remove All Breakpoints"));
         ui.click(new ButtonLocator("&Yes"));
         ui.wait(new ShellDisposedCondition("Remove All Breakpoints"));
      }
   }


Thanks,
Joe
jluebker
 
Posts: 15
Joined: Thu Jul 02, 2009 11:17 am

Re: Checking the enablement of Remove All Breakpoints button

Postby gnebling » Tue Jul 07, 2009 2:56 pm

Yes, this is a bug with isEnabled(). We have a fix and it will be available in the next beta cycle, hopefully in a couple of weeks. We'll let you know when it's available from the product download page for you to try.
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Re: Checking the enablement of Remove All Breakpoints button

Postby gnebling » Fri Jul 17, 2009 10:30 am

The fix is now available in the latest 3.9.1 beta that can be fetched here:

http://www.instantiations.com/windowtes ... nload.html

Let us know how it works.

Regards,
- WT Support
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest