locked
What is the best way to expand all nodes in a tree control? Node children are created on demand and I cannot search for a node before its parent has been expanded. RRS feed

  • Question

  • <!-- [if gte mso 10]> <mce:style>

    Hello All,

    Thanks for your time first off! I am working with an Infragistics Ultratree control. The control is set up to load the descendant nodes of other nodes on demand and not before they are required. That is, a node has 0 children until it has been expanded. Thus even if a tree node is expected to be at a certain location in the tree it will not be located until its parent has been expanded.

    I am trying to write a general function that will locate a node at an arbitrary place in a tree. I have already tried using SearchConfiguration = ExpandWhileSearching on a WinTreeItem and it does not solve the problem. I can only assume that this is due to on demand loading.

    The solution I prefer is to expand the entire tree before trying to search for any node. I have previously written about recursively navigating a WinTree
    ( http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/2d8e7a10-6bfe-40bb-aed5-4f994cc02559 ) by using the “Nodes” member of a WinTreeItem, however there are some problems with performance. The code I am using to do this is as follows, with the call to start recursion commented out:

     

    public static void ExpandAllNodesInTree(WinTree myTreeToExpand)
    {
      Trace.WriteLine("Output location 1");
      int numRoots = myTreeToExpand.Nodes.Count;
      Trace.WriteLine("Output location 2");
      object m_nodeItem = null;
      for (int i = 0; i < numRoots;i++)
      {
        Trace.WriteLine("Output location 3");
        m_nodeItem = (object)myTreeToExpand.Nodes[i];
        Trace.WriteLine("Output location 4");
    
        if (m_nodeItem is WinCheckBoxTreeItem)
        {
          ((WinCheckBoxTreeItem)m_nodeItem).Expanded = true;
        }
    
        if (m_nodeItem is WinTreeItem)
        {
          ((WinTreeItem)m_nodeItem).Expanded = true;
        }
              
        //ExpandAllSubTreeItems(m_nodeItem);
      }
    }
    
    
    private static void ExpandAllSubTreeItems(object myItemToExpand)
    {
      if (myItemToExpand is WinCheckBoxTreeItem)
      {  
        ((WinCheckBoxTreeItem)myItemToExpand).Expanded = true;
        int numChildren = ((WinCheckBoxTreeItem)myItemToExpand).Nodes.Count;
        for (int i = 0; i < numChildren; i++)
        {
          object tempObj = ((WinCheckBoxTreeItem)myItemToExpand).Nodes[i];
          ExpandAllSubTreeItems(tempObj);
        }
      }
    
      if (myItemToExpand is WinTreeItem)
      {
        ((WinTreeItem)myItemToExpand).Expanded = true;
        int numChildren = ((WinTreeItem)myItemToExpand).Nodes.Count;
        for (int i = 0; i < numChildren; i++)
        {
          object tempObj = ((WinTreeItem)myItemToExpand).Nodes[i];
          ExpandAllSubTreeItems(tempObj);
        }
      }
    }

     

    Please take note of the following lines in the code:

    Trace.WriteLine("Output location 1");
    int numRoots = myTreeToExpand.Nodes.Count;
    Trace.WriteLine("Output location 2");
    ...
    Trace.WriteLine("Output location 3");
    m_nodeItem = (object)myTreeToExpand.Nodes[i];
    Trace.WriteLine("Output location 4");

    Now here is the debug trace when this code is run on a tree with one root node.
    -----------------------------------------------------------------------------------------------

    Output location 1

    W, 2196, 13, 2010/06/15, 14:25:54.455, 394166447559, QTAgent32.exe, PERF WARNING: CacheQueryId: took 139 ms. Expected it to take maximum 100 ms.

    Output location 2

    Output location 3

    W, 2196, 13, 2010/06/15, 14:25:54.683, 394167262179, QTAgent32.exe, PERF WARNING: CacheQueryId: took 111 ms. Expected it to take maximum 100 ms.

    Output location 4

    W, 2196, 13, 2010/06/15, 14:25:55.208, 394169143963, QTAgent32.exe, <a class=success>Playback - {1} [SUCCESS] Expand  < Item Expanded/Collapsed via Numpad keys >

    \0</a>

    W, 2196, 13, 2010/06/15, 14:25:55.328, 394169572215, QTAgent32.exe, IEDOM : StopSession of the plugin called before StartSession

    W, 2196, 13, 2010/06/15, 14:25:55.329, 394169576083, QTAgent32.exe, UIA : StopSession of the plugin called before StartSession

    -----------------------------------------------------------------------------------------------

    So in between “Output location 1” and “Output location 2” the reference:
      myTreeToExpand.Nodes.Count;

    And between “Output location 3” and “Output location 4” the reference:
      (object)myTreeToExpand.Nodes[i];

    Caused some PERF WARNING warnings. If the tree has more items in it (even 20), navigating the tree takes an absurd amount of time and a huge number of this warning will appear in the debug trace.

    There was one answer proposed to my previous question/discussion thread and there were two points:

    1.      The solution you have implemented to look for the TreeItem control is not ideal in terms of perf. Using CodedUI Test recording / or adding the control to UI Map, you can generate a better search condition which will restrict your search to a single path from root tree element to the target tree element. Here, you are trying to search across all paths get to your target element which will of course take more time.

    2.      Regarding the PERF WARNING in CacheQueryId, this will happen if the query ID is too big such as in nested tree item scenarios. For tree items, we generate the entire hierarchy (for search) till the ancestor tree. If your tree item depth is too high, it will take time in generating the search condition for all tree items in its path. [Normally we generate the QueryID for element -> Parent -> Top level window, but there are lot of special scenarios such as this one where we need an extended queryID ancestor hierarchy to be able to playback correctly]


    I appreciate the response but I do not believe 1) helps me at all because I am not recording anything against any tree. The main reason for not recording anything from the trees I am using is that no child elements exist under a parent until that parent is expanded, and I cannot determine what parent to expand without searching for the child.

    I believe the best way to proceed for our tests is to expand the whole tree once, suffer the cost of doing the expansion and test with a full tree. However, the apparent cost of using the Nodes collection in a WinTreeItem is huge. I have no doubt that I don’t understand fully the Coded UI Test system but I have tried a bunch of things to get around this and nothing seems to work if I use the Nodes collection. I have done this by sending keyboard input and it is interesting to note that if one examines the debug trace above it seems that in the case of this control at least, the line of code:

    ((WinTreeItem)m_nodeItem).Expanded = true;

      uses the Numpad keys to do the expansion and collapse of tree nodes anyways

    W, 2196, 13, 2010/06/15, 14:25:55.208, 394169143963, QTAgent32.exe, <a class=success>Playback - {1} [SUCCESS] Expand  < Item Expanded/Collapsed via Numpad keys >

    This in itself is fine with me, but I find it odd that I have not been able to write a function that accesses the Nodes collection of a tree or a tree node without causing the system to have all of these PERF WARNINGS and grind to a halt making using the Nodes collection impossible.

    Now on this subject, part 2) of the reply above gives some information about this PERF WARNING issue, although I don’t know what the answer means exactly. I tried to look around the net for information on CacheQueryID , and QueryID but wasn’t able to locate much of anything. So my question here is what do you mean by “we need an extended queryID ancestor hierarchy to be able to playback correctly” and how do I do this, keeping in mind that I do not record anything using the Coded UI Test Builder?

    Is there some examples of this on the forum or where do I read about what this particular warning means and how to fix or work around it? I do not use the Coded UI Test Builder for much of anything other than identifying UI Elements and getting their identification information into a UIMap. No methods are generated in a UIMap, only the UI element identification information.

    I have a couple of thoughts on how the process for expanding all nodes in a tree could be done and if anyone has any input it would be great. First off, again, I want to expand the entire tree recursively using the Nodes collection as it seems like the most natural way to think about the problem. Unfortunately since this causes the huge delays I have reported, I came up with another idea.

    A) I thought about writing an extension plug-in that exposes the “Expanded” property that I see in WinTreeItem as a Search Property. Thus it would be possible to search for any WinTreeItem that had Expanded set to false. I thought this might speed the process up a bit, and I have verified that during execution of a Coded UI Test, the unexpanded nodes show us as Expanded = false in the debugger so it seems this method would be ok. Has anyone tried something like this?

    B) Another point I would like to make is that our tree uses WinTreeItem and the WinCheckBoxTreeItem in the same tree, so I have wound up having to write code that deals with them separately as cases since they both subclass WinControl only. My question is why does WinCheckBoxTreeItem not subclass WinTreeItem or why do they both not subclass some other class that has their common functionality encapsulated? It would be much more convenient if it was possible to just cast them both to a type that has the common functionality so I don’t have to deal with them separately.

    C) Unfortunately the Ultratree control does not support the newer UI Automation and ControlPatterns like some other tree controls I have inspected with UISpy.exe. I was debating trying to write my own code to interact with this control using MSAA although I really had hoped it would be easier than having to do this kind of thing. Does anyone have advice on this? I have access to these books http://www.amazon.com/NET-COM-Complete-Interoperability-Guide/dp/067232170X and I’d be able to figure everything out eventually but it seems like this could be overkill or a waste of time, but then again it could be a good way to learn and might give good results; since I don’t know I thought I’d ask here.

     

    Thanks very much for your time,

     

    Elliot

     

    Tuesday, June 15, 2010 9:55 PM

Answers

  • Hi

    To expand all the nodes of a tree view, can try this manually first

    1) Select the top most Tree Node

    2) Press * key

    Does this expand all the item? If yes then you can possibly do this using Codeduitest to expand all nodes

    Thanks

    Siddhartha

    • Marked as answer by EM_ENI Wednesday, June 16, 2010 2:19 PM
    Wednesday, June 16, 2010 6:25 AM
    Moderator
  • To answer your question -- "So my question here is what do you mean by “we need an extended queryID ancestor hierarchy to be able to playback correctly” and how do I do this, keeping in mind that I do not record anything using the Coded UI Test Builder?"

    Did you specify ExpandWhileSearching for the target tree item only? You need to specify it for all the tree items in the ancestor hierarchy till the tree control. Also, since the tree items are generated dynamically, it is absolutely essential to generate the entire tree hierarchy in the search condition. i.e. if the tree is something like --

    A

    | _ B

    | _ C

          | _ D

               | _ E

    The search condition should be  A (ExpandWhileSearching) -> C (EWS) -> D (EWS) -> E (EWS). This will give the most optimized perf during playback.

    CodedUI Test automatically generates the entire ancestor hierarchy and that's the reason the QueryId generation takes more time if the tree item is nested deeply.

    To answer your question - "The main reason for not recording anything from the trees I am using is that no child elements exist under a parent until that parent is expanded, and I cannot determine what parent to expand without searching for the child."

    - It looks you are trying to do an exploratory action. However, instead of expanding the entire tree, why don't you try out a DepthForstSearch or BreadthFirstSeatrch approach? That will be more optimized in terms of perf. Of course the worst case scenario may be that you need to expand the entire tree to get to the last tree item, but average case scenario should improve.

    To answer your [B], point noted! But unfortunately thats the way it is now. We might consider this in future version.

    To answer your [C], we are coming up with the new plugin extension for supporting Infragistics controls which do not have good accessiblity (such as MSAA). Please get in touch with [mathewan AT microsoft DOT com] for the exact timeline for release.

     

    • Marked as answer by EM_ENI Wednesday, June 16, 2010 2:19 PM
    Wednesday, June 16, 2010 12:44 AM

All replies

  • To answer your question -- "So my question here is what do you mean by “we need an extended queryID ancestor hierarchy to be able to playback correctly” and how do I do this, keeping in mind that I do not record anything using the Coded UI Test Builder?"

    Did you specify ExpandWhileSearching for the target tree item only? You need to specify it for all the tree items in the ancestor hierarchy till the tree control. Also, since the tree items are generated dynamically, it is absolutely essential to generate the entire tree hierarchy in the search condition. i.e. if the tree is something like --

    A

    | _ B

    | _ C

          | _ D

               | _ E

    The search condition should be  A (ExpandWhileSearching) -> C (EWS) -> D (EWS) -> E (EWS). This will give the most optimized perf during playback.

    CodedUI Test automatically generates the entire ancestor hierarchy and that's the reason the QueryId generation takes more time if the tree item is nested deeply.

    To answer your question - "The main reason for not recording anything from the trees I am using is that no child elements exist under a parent until that parent is expanded, and I cannot determine what parent to expand without searching for the child."

    - It looks you are trying to do an exploratory action. However, instead of expanding the entire tree, why don't you try out a DepthForstSearch or BreadthFirstSeatrch approach? That will be more optimized in terms of perf. Of course the worst case scenario may be that you need to expand the entire tree to get to the last tree item, but average case scenario should improve.

    To answer your [B], point noted! But unfortunately thats the way it is now. We might consider this in future version.

    To answer your [C], we are coming up with the new plugin extension for supporting Infragistics controls which do not have good accessiblity (such as MSAA). Please get in touch with [mathewan AT microsoft DOT com] for the exact timeline for release.

     

    • Marked as answer by EM_ENI Wednesday, June 16, 2010 2:19 PM
    Wednesday, June 16, 2010 12:44 AM
  • Hi

    To expand all the nodes of a tree view, can try this manually first

    1) Select the top most Tree Node

    2) Press * key

    Does this expand all the item? If yes then you can possibly do this using Codeduitest to expand all nodes

    Thanks

    Siddhartha

    • Marked as answer by EM_ENI Wednesday, June 16, 2010 2:19 PM
    Wednesday, June 16, 2010 6:25 AM
    Moderator
  • Hi Siddhartha,

    Thanks for the response, yes that does work. That's one of the ways I was doing the expansion via keypress. My framework provides a function that takes a WinTree as an argument, selects each of the "root" nodes (since this control supports more than one "root") and presses the '*' key. This does work, and is fine for my purposes at this time.

    However, if this framework is applied to testing our software with large projects active, then each nodes children may need data to be loaded from a database offsite on demand. This could take a long time, but this is not something that is avoidable since the tree structure can be unpredictable. For large projects, it may not be possible to find elements without imposing some restrictions on input data so that we don't have to expand the whole tree. Agreeing with what Tapas suggested, I think that a Depth first search is the way to go in large databases. Thanks again, marked as answer.

     

    Cheers,

    Elliot

    Wednesday, June 16, 2010 2:19 PM
  • Did you specify ExpandWhileSearching for the target tree item only? You need to specify it for all the tree items in the ancestor hierarchy till the tree control. Also, since the tree items are generated dynamically, it is absolutely essential to generate the entire tree hierarchy in the search condition. i.e. if the tree is something like --

    A

    | _ B

    | _ C

          | _ D

               | _ E

    The search condition should be  A (ExpandWhileSearching) -> C (EWS) -> D (EWS) -> E (EWS). This will give the most optimized perf during playback.

    CodedUI Test automatically generates the entire ancestor hierarchy and that's the reason the QueryId generation takes more time if the tree item is nested deeply.

    Hello Tapas,

    I must really not understand what is going on with what you are talking about when you say "search conditions". Using your example, lets say I have a tree where it is only displaying A which is unexpanded (so B and C and their children have not been created yet since they are created on demand). All that is in the UIMap is the WinTree which is my reference to the tree control, no nodes can be in the UIMap.

    First, I did take your advice and always make sure to do:

    tempSearch.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);

    when using the following code where the WinTree is passed into ExpandTreeByUsingSearchItems (note commented out lines with .Expanded = true):

     

    public static void ExpandTreeByUsingSearchItems(WinTree myTreeToExpand)
    {
      UITestControl tempSearch = new UITestControl(myTreeToExpand);
      tempSearch.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
      int numRoots = myTreeToExpand.Nodes.Count;
      UITestControl m_nodeItem = null;
    
      for (int i = 0; i < numRoots; i++)
      {
        m_nodeItem = (UITestControl)myTreeToExpand.Nodes[i];
        tempSearch.SearchProperties["Name"] = m_nodeItem.Name;
        Trace.WriteLine(m_nodeItem.Name);
    
        if (m_nodeItem is WinTreeItem)
        {
          WinTreeItem tempRefToSubTreeRoot = (WinTreeItem)m_nodeItem;
          //tempRefToSubTreeRoot.Expanded = true;
          ExpandChildWinTreeItemUsingSearchItems(tempRefToSubTreeRoot);
        }
    
        if (m_nodeItem is WinCheckBoxTreeItem)
        {
          WinCheckBoxTreeItem tempRefToSubTreeRoot = (WinCheckBoxTreeItem)m_nodeItem;
          //tempRefToSubTreeRoot.Expanded = true;
          ExpandChildCheckBoxTreeUsingSearchItems(tempRefToSubTreeRoot);
        } 
      }
    }
    
    public static void ExpandChildWinTreeItemUsingSearchItems(WinTreeItem mySubTreeRoot)
    {
      UITestControl tempSearch = new UITestControl(mySubTreeRoot);
      tempSearch.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
    
      int numSubNodes = mySubTreeRoot.Nodes.Count;
    
      object m_nodeItem = null;
    
      for (int i = 0; i < numSubNodes; i++)
      {
        m_nodeItem = mySubTreeRoot.Nodes[i];
    
        tempSearch.SearchProperties["Name"] = ((UITestControl)m_nodeItem).Name;
        Trace.WriteLine(tempSearch.SearchProperties["Name"]);
    
        if (m_nodeItem is WinTreeItem)
        {
          WinTreeItem tempRefToSubTreeRoot = (WinTreeItem)m_nodeItem;
          //tempRefToSubTreeRoot.Expanded = true;
          ExpandChildWinTreeItemUsingSearchItems(tempRefToSubTreeRoot);
        }
    
        if (m_nodeItem is WinCheckBoxTreeItem)
        {
          WinCheckBoxTreeItem tempRefToSubTreeRoot = (WinCheckBoxTreeItem)m_nodeItem;
          //tempRefToSubTreeRoot.Expanded = true;
          ExpandChildCheckBoxTreeUsingSearchItems(tempRefToSubTreeRoot);
        } 
      }
    }
    
    public static void ExpandChildCheckBoxTreeUsingSearchItems(WinCheckBoxTreeItem mySubTreeRoot)
    {
      UITestControl tempSearch = new UITestControl(mySubTreeRoot);
      tempSearch.SearchConfigurations.Add(SearchConfiguration.ExpandWhileSearching);
    
      int numSubNodes = mySubTreeRoot.Nodes.Count;
    
      object m_nodeItem = null;
    
      for (int i = 0; i < numSubNodes; i++)
      {
        m_nodeItem = mySubTreeRoot.Nodes[i];
    
        tempSearch.SearchProperties["Name"] = ((UITestControl)m_nodeItem).Name;
        Trace.WriteLine(tempSearch.SearchProperties["Name"]);
    
        if (m_nodeItem is WinTreeItem)
        {
          WinTreeItem tempRefToSubTreeRoot = (WinTreeItem)m_nodeItem;
          //tempRefToSubTreeRoot.Expanded = true;
          ExpandChildWinTreeItemUsingSearchItems(tempRefToSubTreeRoot);
        }
    
        if (m_nodeItem is WinCheckBoxTreeItem)
        {
          WinCheckBoxTreeItem tempRefToSubTreeRoot = (WinCheckBoxTreeItem)m_nodeItem;
          //tempRefToSubTreeRoot.Expanded = true;
          ExpandChildCheckBoxTreeUsingSearchItems(tempRefToSubTreeRoot);
        }
      }
    }

    This didn't work as the debug trace only has this in it:

    --------------------------------------------------------------------

    W, 5236, 13, 2010/06/16, 13:10:00.842, 687140825052, QTAgent32.exe, PERF WARNING: CacheQueryId: took 149 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:01.040, 687141530370, QTAgent32.exe, PERF WARNING: CacheQueryId: took 144 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:01.360, 687142677478, QTAgent32.exe, PERF WARNING: CacheQueryId: took 259 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:01.831, 687144361142, QTAgent32.exe, PERF WARNING: CacheQueryId: took 185 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:02.271, 687145938163, QTAgent32.exe, PERF WARNING: CacheQueryId: took 209 ms. Expected it to take maximum 100 ms.
    "ROOT"
    W, 5236, 13, 2010/06/16, 13:10:10.473, 687175300782, QTAgent32.exe, PERF WARNING: CacheQueryId: took 220 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:10.844, 687176627986, QTAgent32.exe, PERF WARNING: CacheQueryId: took 274 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:11.185, 687177851931, QTAgent32.exe, PERF WARNING: CacheQueryId: took 150 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:11.487, 687178930756, QTAgent32.exe, PERF WARNING: CacheQueryId: took 223 ms. Expected it to take maximum 100 ms.
    "LEVEL1"
    W, 5236, 13, 2010/06/16, 13:10:14.378, 687189276963, QTAgent32.exe, PERF WARNING: CacheQueryId: took 203 ms. Expected it to take maximum 100 ms.
    W, 5236, 13, 2010/06/16, 13:10:14.718, 687190498961, QTAgent32.exe, PERF WARNING: CacheQueryId: took 208 ms. Expected it to take maximum 100 ms.
    "LEVEL2"
    W, 5236, 13, 2010/06/16, 13:10:17.658, 687201018908, QTAgent32.exe, IEDOM : StopSession of the plugin called before StartSession
    W, 5236, 13, 2010/06/16, 13:10:17.659, 687201022866, QTAgent32.exe, UIA : StopSession of the plugin called before StartSession

     

    --------------------------------------------------------------------

    But there is another node underneath "LEVEL2", called "LEVEL3" which has 20 other nodes. So that didn't work. Plus even though I explicitly pass in the parent of each node to my "new search items" as the searchLimitContainer, I still get all these PERF WARNINGS.

    What else I can do, it seems there is a problem with how I am using the .Nodes collection in each WinTreeItem and WinCheckBoxTreeItem as I am because that is where the PERF WARNING(s) seem to come from.

    Since there is no nodes or any tree structure in the UIMap, I don't see how I can construct this "search condition" that you have mentioned any more explicitly.

    I am always passing the parent node to the next level of recursion (child nodes) and trying to use that parent as the searchLimitContainer but it doesn't seem to make any difference.

    I have a workaround for the problem by using the * key or the right arrow key but I am trying to understand why this PERF WARNING happens anytime I try to use the .Nodes collection of a WinTreeItem or WinCheckBoxTreeItem.

    This will even happen when I use the .Nodes collection in a tree item I explicitly search for (and it already is shown since its parent is expanded). I do the following:

     

    public static void ExpandSask(WinTree myTreeToSearch)
    {
      WinCheckBoxTreeItem tempRefToSubTreeRoot = new WinCheckBoxTreeItem(myTreeToSearch);
      tempRefToSubTreeRoot.SearchProperties["Name"] = "Saskatchewan";
    
      Trace.WriteLine("First output point");
      tempRefToSubTreeRoot.Find();
      Trace.WriteLine(tempRefToSubTreeRoot.Nodes.Count);
      Trace.WriteLine("Second output point");
      tempRefToSubTreeRoot.Expanded = true;
      Trace.WriteLine(tempRefToSubTreeRoot.Nodes.Count);
      Trace.WriteLine("Third output point"); 
    }
    and this is the debug trace:

     

    First output point
    0
    Second output point
    W, 5988, 13, 2010/06/16, 13:47:58.254, 695292795488, QTAgent32.exe, <a class=success>Playback - {1} [SUCCESS] Expand - "[MSAA]ControlType='CheckBoxTreeItem' && Name='Saskatchewan'"  < Item Expanded/Collapsed via Numpad keys >
    \0</a>
    W, 5988, 13, 2010/06/16, 13:47:58.969, 695295355057, QTAgent32.exe, PERF WARNING: CacheQueryId: took 281 ms. Expected it to take maximum 100 ms.
    1
    Third output point
    W, 5988, 13, 2010/06/16, 13:47:59.019, 695295534344, QTAgent32.exe, IEDOM : StopSession of the plugin called before StartSession
    W, 5988, 13, 2010/06/16, 13:47:59.021, 695295538168, QTAgent32.exe, UIA : StopSession of the plugin called before StartSession

    So this problem only seems to happen with trying to use the .Nodes collection.

    It seems I am going in circles now though. It seems I have to avoid using the .Nodes collection (please correct me if I am wrong). Perhaps this question will help me understand:

    Lets say there is some tree we don't know what the structure of before test run, and one node is selected. How would I determine which node is selected?

     

    Thanks again for your time!

     

    Best regards,

     

    Elliot

    Wednesday, June 16, 2010 8:06 PM
  • Hey,

     I am also facing the same problem. When using the WinTree.Nodes property it takes years to find a child item and perform operations on it.

    The code I have is simple,

     

    public void ExpandNodes(WinTree tree)

    {

    foreach(WinTree child in tree.Nodes)

    Mouse.DoubleClick(child);

    }

     

    But it takes a lot of time to click the treeview item. I see the above post open for a long time..Is this a known bug that we should not use WinTree.Nodes property or is there a way to loop through all controls and perform click on it?

     

    Tuesday, September 28, 2010 8:44 PM
  • Hi

    To expand all the nodes of a tree view, can try this manually first

    1) Select the top most Tree Node

    2) Press * key

    Does this expand all the item? If yes then you can possibly do this using Codeduitest to expand all nodes

    Thanks

    Siddhartha

    Hi Siddhartha

    Thanks a lot, I can not tell you how much you helped me with this.

    Thanks, thanks, thanks.... :)

    Monday, October 3, 2011 3:14 PM