Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Unable to access context menus in sub classes of an Xviewer tree
icon4.gif  Unable to access context menus in sub classes of an Xviewer tree [message #1692601] Thu, 16 April 2015 18:19 Go to next message
Saar Sagir is currently offline Saar SagirFriend
Messages: 4
Registered: March 2015
Junior Member
UPDATE:
Below is a picture to better describe my problem
index.php/fa/21630/0/

My issue is that regardless of what functions I call, the only context menu it reads is a different context menu that only applies to the top level

The only way I can get the correct context menu to click the item I need is by manually right clicking that segment when it begins it's search of the item

tree = bot.tree(2);
SWTBotTreeItem[] dbdtrees = tree.getAllItems();
tree.expandNode(dbdName);
dbdtrees[0].getNode("ORDER").contextMenu("Import COBOL or PL/I Data Structures").click();

The above code works without error, however, it selects and click's the ORDER segment but choses the "Import ..." menu from the base DEALERDBD file (I can check because the wizard would have different settings on start). Both the top level dbd and child level segments contain "Import ..." as one of their menus however the top level does not contain "Add or Edit Fields" while the lower does contain it as shown in picture above.

If I attempt to change it to
dbdtrees[0].getNode("ORDER").contextMenu("Add or Edit Fields").click();

Then the program freezes at that stage and gives an error of widget not found. However if I chose to right click that segment myself when it searches for the menu, it finds and clicks the correct item and opens the correct wizard

I would really appreciate any help and need to get this resolved ASAP

[Updated on: Tue, 26 May 2015 18:12]

Report message to a moderator

Re: Unable to access context menus in sub classes of an Xviewer tree [message #1693391 is a reply to message #1692601] Thu, 23 April 2015 17:38 Go to previous messageGo to next message
Saar Sagir is currently offline Saar SagirFriend
Messages: 4
Registered: March 2015
Junior Member
The problem is that regardless of what functions I call, the context menu that gets called is only the one created by the top level "DEALERDB".
For example, both top level and lower level contain "Import COBOL or PL/I Data Structures" in their menus, which works when I call them however it only opens the wizard from the "DEALERDB" level (which I can check in the settings of the wizard)

If I attempt to call any other menu item that is not in the DEALERDB but is in the ORDER row, such as "Add or Edit Fields", it gives me a widget not found error

This is a sample of the code I have been trying to test
Each of these lines gives Widget not found error however if I change the contextMenu parameter to any menu located in the "DEALERDB" it works with no errors


tree = bot.tree(2);
SWTBotTreeItem[] dbdtrees = tree.getAllItems();
SWTBotTreeItem[] segtrees = dbdtrees[0].getItems();
tree.expandNode(dbdName);

// Trial one, getting the Node for Order and clicking the item in the context menu - Same error as explained above
dbdtrees[0].getNode("ORDER").contextMenu("Add or Edit Fields").click();

// Trial two, selecting the segment and clicking the item in the context menu - Same error as explained above
tree.select(segName).contextMenu("Add or Edit Fields").click();

// Trial three, getting list of segments and selecting or expanding them - Same error as explained above
segtrees[0].select().expand().contextMenu("Add or Edit Fields").click();

// All of these work the same as the following, which doesnt contain "Add or Edit Fields" but does contain "Import COBOL ... " which works
tree.expandNode(dbdName).contextMenu("Add or Edit Fields").click();

[Updated on: Tue, 26 May 2015 18:13]

Report message to a moderator

Re: Unable to access context menus in sub classes of an Xviewer tree [message #1693397 is a reply to message #1693391] Thu, 23 April 2015 18:28 Go to previous message
Saar Sagir is currently offline Saar SagirFriend
Messages: 4
Registered: March 2015
Junior Member
Still haven't found a solution, Any help would be greatly appreciated

[Updated on: Tue, 26 May 2015 18:13]

Report message to a moderator

Previous Topic:Using SWTBot with an existing RCP application
Next Topic:What SWTBOT tests exist for Eclipse?
Goto Forum:
  


Current Time: Fri Apr 19 00:28:32 GMT 2024

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

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

Back to the top