Thanks Mike!
I tried viewing the child nodes as child objects of the JavaTree
object. But it doesnt work.
QTP doesnt identify those child nodes as children JavaTree Object, but
it identifies them as Items( or we may call them sub-items).
The strange thing is that I am able select the child node by using the
separator-
JavaTree("Tree").Select("Parentnode";"childnode")
But the same thing fails for GetItem, even though the QTP user guide
says it should work !
I am tryiing to reach the Mercury support to see if they can help.
Thanks,
Vishal
On Feb 24, 10:28 pm,
m...@mikepietsch.com wrote:
> Vishal,
>
> If I remember correctly (don't have QTP in front of me) GetItem only
> takes an index as a parameter. While everything in VBScript is a
> variant, the implication of an index is an int value. If you passed
> in "0", the variant string should be cast to an int 0, but "0;0" would
> not be cast to a int value, so the complaint that there is an invalid
> argument would be an appropriate response to the line:
>
> JavaTree("tree").GetItem("0;0")
>
> Since you already know that but JavaTree("tree").GetItem("0") is
> valid, I might point out that it would be more correct to write:
>
> JavaTree("tree").GetItem(0)
>
> However, none of that solves any of your issue. My initial thought(s)
> would be
>
> 1) Look at the child items as a collection and loop through the
> collection, and evaluate each to find the one or more child items you
> are looking for.
>
> - or -
>
> 2) use a description object to describe the child node that you are
> looking for and work with it directly.
>
> Mike Pietsch
>
> Quoting Vishal <
surivis...@gmail.com>:
>
>
>
>
>
> > Hi
>
> > I am trying to get the text/label of a child node of a javatree but
> > the GetItem method is not working for the child node.
>
> > For example, I have a tree with first node as "Parent1" and it has a
> > child node "Child1"
> > GetItem method is returning only the parent node value.
> > JavaTree("tree").GetItem("0") gives me "Parent1"
> > but JavaTree("tree").GetItem("0;0") gives an error that the function
> > has invalid arguments.
>
> > I am able to use the select method to select the node using the
> > separator
> > JavaTree("tree").Select "Parent1;Child1"
>
> > Will really appreciate if anyone can provide some help/workaround.
>
> > Thanks
> > Vishal- Hide quoted text -
>
> - Show quoted text -