+ return getTreeItem(bot, currentNode, Arrays.copyOfRange(nodeNames, 1, nodeNames.length));
+ }
+
+ /**
+ * Get the tree item from a parent tree item at the specified location
+ *
+ * @param bot
+ * the SWTBot
+ * @param treeItem
+ * the treeItem to find the tree item under
+ * @param nodeNames
+ * the path to the tree item, in the form of node names (from
+ * parent to child).
+ * @return the tree item
+ */
+ public static SWTBotTreeItem getTreeItem(SWTBot bot, SWTBotTreeItem treeItem, String... nodeNames) {
+ if (nodeNames.length == 0) {
+ return treeItem;
+ }
+
+ SWTBotTreeItem currentNode = treeItem;
+ for (int i = 0; i < nodeNames.length; i++) {
+ bot.waitUntil(ConditionHelpers.treeItemHasChildren(treeItem));