Hi
I had a scenario to automate a script where i need to get the child items to be selected from the swftreeview, which is of gridtree,
For example Java is the root tree and in that j22e, veriosn of java, version of J2ee these are the child elements of the Jave i need to get the version of java now that is the child element of java in the save way i need to get the grandchild elements also.Please try to help me regarding this, It would be very great to share with me if you have any idea regarding this. Please let me know so that i can go ahead with this
Its very urgent, Please try to help me out
Regards,
Srikanth
Hi Srikanth,
What you are asking is possible, although it will take a bit of work to build the specifics of what you want to acheive. Below are a few of the basic functions that TestAdvantage and QuickTest Professional have that will assist you in doing what you want to do.
' To make this more ledgable I am going to assume the followingSet tree = SwfWindow("Form1").SwfTreeView("ultraTree1")
TestAdvantage Functions :
QuickTest Professional Functions :
You could use GetContent() to get all the currently visible nodes. You can then Split that list into an Array, loop through them, and Call ExpandAll on all the visible nodes, and you will have all possible nodes visible. Call GetContent() again, then you will get a list of all of the nodes.
If you want to handle the individual tier nodes in order, you can just either just expand the parent, or use something like:IF parentNode = Mid(currentNode, 0, Len(parentNode))to determine if the node you are currently testing is a child of the parent node. There are a number of approaches based on what you might want to do. But hopefully the functions supplied will help you with what you need to do.
Hi ,
I am not able to read the get the values from SwfTreeView (Infragistics.Win.UltraWinTree.UltraTree)
These are the values I am getting for the common methods.
The tree is in expanded mode
GetContent : \\\\\\
GetItemsCount : 4GetSelection : \\
GetItem : (Its rerurning blan for indexes from 0 to 4)
While recording also the recorded step is appearing as
SwfTreeView("ultratrevLOB").Select "\\"
SwfTreeView("ultratrevLOB").ActivateNode "\"
SwfTreeView("ultratrevLOB").Select "\"
Please let me know how I can get the contents and select a particular Item
My first thought is that your Text properties are blank, as the Node path is constructed by a leading "\" followed by a "\" delimited path. So that you would have a path like:
\Parent1\Child1\GrandChild1
GetItem just gets the individual Node Text, not the entire path. So that if you are using GetItem on the example above you would get GrandChild1. What do you use to uniquely identify your Nodes in the UltraTree? Can you include a screen shot?
Hello,
You can pass in the key to Select instead of the path. Paths being with a leading "\" and represent the text of each node path through the tree, whereas keys are programmatically set by the developer.
You can find out the keys for each node from your developers, or use GetNAProperty if necessary. You can learn about the WinTree API here.
Hi Alan,
Is there any method to select a particular record in treeview with nodeid and "key" or "column title"
Because in my case every record in treeview holds same nodeid say"\5"
But am able to get data under column "Seq"(second column in grid) by getcelldata ("nodedid", "Seq") Note: here nodeid varies for each and every records in treeview since i have mentioned column name
So is there any same way to select specific records with nodeid respective of column name
Activation and Selection are different concepts. There can only be one active node/cell at a time while there can be many selected nodes. I believe you will want to use the SelectMultiple method. You should be able to see an example of this if you record selecting multiple items.
Hi Mike,
Thank you very much for your solution it is working fine
But in my case i have to select all the rows which has specifc data by iterating through treeview table
I have tried like this,
For i = 1 to 100 step 1
Seq = SwfWindow("DPS").SwfTreeView("treeseq").GetCellData("\4", "Seq")
If Seq = 10 then
'I have added code to hold ctrl key
SwfWindow("DPS").SwfTreeView("treeseq").ActivateCell "\4", "Seq"
End if
Next
Still from above code am only able to select 1 row at a time
Could you please help me to select multiple rows
I recommend using ActivateNode for this purpose. GetCellData will get the information in a cell, but won't select it. I built the following script line based on the information you've provided so far.
Please try the following and let me know whether it works.