Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SwtBotTree's getNode/getAllItems problem
SwtBotTree's getNode/getAllItems problem [message #665630] Fri, 15 April 2011 06:13 Go to next message
Aparna Argade is currently offline Aparna Argade
Messages: 12
Registered: October 2010
Junior Member
1. SWTBotTree's getAllItems() returns only first level children. Is there any way to get 2nd/3rd level children?
This problem seems to be discussed at many places. But still the behaviour is the same.

2. I want to select 2nd level node by using,
tree.expandNode(project).getNode(file).select();

Here it can not find the file node. Actually it is present.
I've seen that sometimes it has worked but most of the times it has failed.
Re: SwtBotTree's getNode/getAllItems problem [message #665793 is a reply to message #665630] Fri, 15 April 2011 21:18 Go to previous message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Hi Aparna,


This happens because some trees expand in a lazy way(for performance
reasons) on a background thread.

You should be using getTreeItem() instead of getNode() to get around
this problem.

The getNode() is a fast way of accessing the item when you know that the
tree is eagerly populated and don't want the overhead of the waitUntil().

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot | @ketanpkr

On 4/15/11 3:13 AM, Aparna wrote:
> 1. SWTBotTree's getAllItems() returns only first level children. Is
> there any way to get 2nd/3rd level children?
> This problem seems to be discussed at many places. But still the
> behaviour is the same.
>
> 2. I want to select 2nd level node by using,
> tree.expandNode(project).getNode(file).select();
>
> Here it can not find the file node. Actually it is present. I've seen
> that sometimes it has worked but most of the times it has failed.
>
Previous Topic:Different test results when running headless SWTBot
Next Topic:second level context menu
Goto Forum:
  


Current Time: Sat Jul 26 15:32:42 EDT 2014

Powered by FUDForum. Page generated in 0.01868 seconds