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
Basically from what I can tell, you are not displaying the actual node text, you are displaying the first probably two columns with no border and no labels. The actual Text property for the Node is blank. Which is fine if you have the NodeTextColumn for the DisplayColumnSet set to your dominate unique column. The NodeTextColumn basically says, for each Node with a ColumnSet defined, use the value in cell that correseponds with that Column to set the Text property. In the first scenario your NodeTextColumn is either blank, or set to a column with No values in it, and your Text property is also blank. So your path to the Nodes are blank. In the second scenario you have a NodeTextColumn defined, but it's on a non-unique column, so you won't be able to record the way you would expect.
What I would suggest is using GetCellData which instead uses Index path's and Columns
cellVal = tree.GetCellData("\2\1\0", "Column1")
Hi Michael,
Iam having the same query,
I have followed above solution provided by you to get data from treeview using GetCellData
Could you please help me to select the specific row with data which is retreived from above step?
For example:
SwfWindow("DPS").SwfTreeView("treeseq").GetCellData("\4", "Seq")
Result:
Ill get data which lies in 5 row and 'Seq' colum
As per result i have to select row 5
Please help me to select specific(multiple) rows
Hello,
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.
SwfWindow("DPS").SwfTreeView("treeseq").ActivateCell "\4", "Seq"
Please try the following and let me know whether it works.
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
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
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.
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