click on a tree view item

Sep 24, 2010 at 3:22 AM

How do i click on a tree view item?  The hierarachy in UI spy is as Window->ChildWindow\Custom\TreeViewitem can someone please help?  Thanks,

Sep 24, 2010 at 4:08 AM

White.Core.UIItems.TreeItems.Tree newTree=    window.Get<White.Core.UIItems.TreeItems.Tree>("TreeName")

newTree.node("ParentTree","Childnode").Click();

 

you can give n number of node names inside the node method as params.....

 

Sep 24, 2010 at 6:28 AM

What will be the TreeName in this case? Is it the level right above the TreeViewitem? I have treeviewitem under the custom so in thatcase will it be custom?

Sep 24, 2010 at 6:35 AM


Treename should be the control name of Treeview........

static White.Core.UIItems.WindowItems.Window window;

 

using the above statement  i am getting the window controler ...

then window.Get<White.Core.UIItems.TreeItems.Tree> ("TreeviewControlName")    method will return the control object ..

 

am i making sense?

 

Sep 24, 2010 at 6:51 AM

yes, I have the control name as (ControlType.TreeViewItem). One more thing, what is the referenced for the ParentTree and Childnode, can you please give an example. thanks a lot.

Sep 24, 2010 at 7:25 AM

lemme try ...

here goes the hierarchy of the Treeview in my window

 

-Contacts

             --Name

             --Address

                        ---permanent

                        ---Temporary

lets assume that the control name of the treeview (Contact) is contactTreeView

so the initialisation should go like this

    

White.Core.UIItems.TreeItems.Tree newTree=    window.Get<White.Core.UIItems.TreeItems.Tree>("contactTreeView")

so u if u want to trigger a click event on the ---Temprory node inside --Address node the code goes like this

newTree.node("Address","Temporary").Click();   // params inside this method are just the caption of each node

 

i am not sure abt the Custum controls but i believe when ur window get loaded if you are giving only the treeView Item name it should work in white .. give a try...

  

 

Sep 24, 2010 at 8:03 AM

the hierarchy level displayed in UI spy, looks like below and  i want to click on an item ABC. On the Gui part i have a child window which contains the item ABC where i want to perform a click action. There is no caption given for the TreeView and also for the the control name , I am using the Automation id of the Tree View . Can you please take a look at the code below and let me know if there is a problem. Thsnks  a lot

Window

ChildWindow

   Custom

     TreeView

     TreeViewitem

        ABC

 

White.Core.UIItems.TreeItems.

Tree newTree = ChildWindow.Get<White.Core.UIItems.TreeItems.Tree>(SearchCriteria.ByAutomationId("_mainTreeView"

));

 

newTree.Node("ABC").click();

Sep 24, 2010 at 8:08 AM
sonia123 wrote:

the hierarchy level displayed in UI spy, looks like below and  i want to click on an item ABC. On the Gui part i have a child window which contains the item ABC where i want to perform a click action. There is no caption given for the TreeView and also for the the control name , I am using the Automation id of the Tree View . Can you please take a look at the code below and let me know if there is a problem. Thsnks  a lot

Window

ChildWindow

   Custom

     TreeView

     TreeViewitem

        ABC

 

White.Core.UIItems.TreeItems.

Tree newTree = ChildWindow.Get<White.Core.UIItems.TreeItems.Tree>(SearchCriteria.ByAutomationId("_mainTreeView"

));

 

newTree.Node("ABC").click();

 can  u ping me in yahoo im "arun_pk"  .. now i am off for lunch.. will be back in an hour

Sep 24, 2010 at 2:05 PM

Sorry could not reach you at the given time, let me know when you have a chance again to help me with this. thanks.

Sep 27, 2010 at 6:12 AM

newTree.Node("TreevievItem","ABC").click();

 

hope this will work :)