Menu items which are disabled (grey) aren't found by SWT Bot. It raises a 
WidgetNotFoundException.

This test would not work:
    SWTBotMenu disabledMenu = bot.menu("Save");
    assertTrue(disabledMenu.isDisabled());

You cannot distinguish currently whether the menu item is not there or whether 
it is just disabled.

The reason for this is in the implementation MenuFinder.findMenusInternal(...), 
line 163 - 167:
                if (!menuItem.isEnabled()) {
                    if (log.isDebugEnabled())
                        log.debug(menuItem + " is not enabled, skipping.");
                    continue;
                }

I would propose to simply remove these lines above, but then it would include a 
lot of pseudo menu items, see log:
MenuItem {|} is not enabled, skipping.

What is that? Probably these menu items really can be skipped, but not the 
other one which is visible, but just disabled (grey).

If they are menu item separators, there could be testing support for them, 
because one might want to test that there is an separator between two specific 
menu items. But this is just a minor issue of low importance. So in my opinion 
they could be ignored in the beginning.

I discovered that this line is logged 10 times per 1 statement 
"bot.menu("Save")":
MenuItem {&Save    Ctrl+S} is not enabled, skipping.

This is 9times too often I would say. But that is of course "just" an 
performance issue.

What do you think about that?




      
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to