Hi ,
Is there anybody can give us some help about how to get the treeview value as show in the picture?
And we have some recorded code in below , please take a look at hope there is has some properties can be configured. Many thanks.
trvViewMatchs().click(atPath("Total(13)->Perfect(4)->Location(CAPTION)")); trvViewMatchs().click(atPath("Total(13)->Unmatched(7)->Location(CAPTION)")); trvViewMatchs().click(atPath("Total(13)->Unmatched(7)->c(1)->Location(CAPTION)"));
Thanks in advance.
Hi Rick,
Sorry for the delay in replaying to your question.
you can use the node key instead of its index but keys are sometimes not equal to the visible text:
GetNAProperty("Nodes[key1].Nodes[Key2"].Text
if you want all tree nodes you can use: .GetTestDate("all tree data")
or you can create recursive while loop to scan all nodes checking the Nodes.Count to verify if a node has child nodes attached to it.
For more information about methods of any TestObject you can refer the API section of the product help ehich has a link on the Start Menu.
Hope that will be helpful.
-Ammar
Hi Ammar,
Thanks you very much give us so helpful suggestion. It works well in my progamme.
And i have one more question hope can get your reply .
For example, when if there has some execution changed the node items count that will make the code failed right .
So shall we using one method to get the node text propery by the name value ,someting like this GetNAProperty("nodes["NameA"],Nodes[NameB]") ?
Thanks very much!
Rick
Thanks you very much give us so helpful suggestion. It can work well in my progamme.
Hi,
I'm not sure what are you trying to get here. What do you mean by "treeview value"?
If you want the text of a specific node you can use "GetNAProperty" method as follow:
trvViewMatchs().GetNAProperty("Nodes[0].Nodes[2].Nodes[2].Text")
Regards,
Ammar