Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2013-04-24 08:01:23 -0400
committerMarvin Mueller2013-04-26 04:28:00 -0400
commit5933517c661558944e7b45c4b13f25ace00ff5d9 (patch)
treeea0dcb4554fff486c7b24c83f3d20f0ae46a525f
parent2651cb21115fdf46f4db2aa92b90e762f3919dd7 (diff)
downloadorg.eclipse.jubula.core-2.0.tar.gz
org.eclipse.jubula.core-2.0.tar.xz
org.eclipse.jubula.core-2.0.zip
Non-sprint task - fix for selectMenuByTextpath issue http://bugs.eclipse.org/4063182.0
-rw-r--r--org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/tester/AbstractMenuTester.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/tester/AbstractMenuTester.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/tester/AbstractMenuTester.java
index f049d53a5..bb92dd762 100644
--- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/tester/AbstractMenuTester.java
+++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/tester/AbstractMenuTester.java
@@ -291,7 +291,7 @@ public abstract class AbstractMenuTester extends AbstractUITester {
}
IMenuItemComponent item = navigateToMenuItem(getAndCheckMenu(),
menuItems, operator);
- if (item == null) {
+ if (item == null || item.getRealComponent() == null) {
try {
closeMenu(getAndCheckMenu(), menuItems, operator);
} catch (StepExecutionException see) {
@@ -299,8 +299,7 @@ public abstract class AbstractMenuTester extends AbstractUITester {
// Do nothing
getLog().info("Tried to close a disabled or already closed menu."); //$NON-NLS-1$
}
- throw new StepExecutionException("no such menu item found", //$NON-NLS-1$
- EventFactory.createActionError(TestErrorEvent.NOT_FOUND));
+ throwMenuItemNotFound();
}
item.selectMenuItem();
}
@@ -384,16 +383,17 @@ public abstract class AbstractMenuTester extends AbstractUITester {
protected int getIndexForName(IMenuComponent menu, String name,
String operator) {
IMenuItemComponent [] subElements = menu.getItems();
- int downcount = 0;
+ int ignoreElementCount = 0;
for (int j = 0; j < subElements.length; j++) {
IMenuItemComponent tempMenu = (IMenuItemComponent)subElements[j];
- if (tempMenu.isSeparator()) {
- downcount++;
+ if (!tempMenu.isShowing()
+ || (tempMenu.isSeparator() && tempMenu.isShowing())) {
+ ignoreElementCount++;
}
if (tempMenu.isShowing()
&& MatchUtil.getInstance().match(
tempMenu.getText(), name, operator)) {
- return j - downcount;
+ return j - ignoreElementCount;
}
}
return Integer.MAX_VALUE;

Back to the top