Ok Amit, Now your issue is pretty clear. Try following below points and you
would be able to select your nodes.

1. Expand nodes
In some cases expanding root node expand all nodes. If not, Take item count
and loop until you expand all nodes.
(Note: with each expanding node your item count can change. Take this into
consideration and expand nodes)

2.Tree has a native method called getSelectionPath or something similar to
this. I can provide you exact name on monday.
Start from root node and keep selecting each node. after you select node
getSelectionPath. this way you would come to know which path you have
selected.

3.Convert your path you wanna select into format of selection path and tally
both. if they are same , you are on correct node

For example
I wanted to select Country;State;City. but when I recorded it was in format
#0;#1;#3
So I expanded all nodes and selected each node and then got the selection
path. The format was [Country , State , City].
So I converted format Country;State;City to  [Country , State , City]. and
after selecting each node I used to tally both values.

4.For right clicking a node, Select that particular node, getSelectionPath.
There is another native methods called GetPathBounds(path) which takes path
as parameter. getSelectionPath will return you path object. Send same obj as
parameter to GetPathBounds.
GetPathBouds will return you an object which will have X and Y properties.
Add this X and Y to abs_X and abs_y of tree object. The resultant x and y
would be your coordinates where you wanna right click
Use Mercury.DeviceReplay object. Send X , Y and RightButton as parameter and
it would rightclick for you on selected node.

This is a generic solution for trees on which we cannot directly select
nodes using .Select "Country;State;City" Hope this helps.

On Sat, Nov 6, 2010 at 3:27 PM, Amit Pandey <amitvpandey1...@gmail.com>wrote:

> Hi Ankit, Bhavin,
>
>  I am facing below issues -
>
> 1.  I want to select the nodes present in the Java Tree ( Pls find the
> attached snap).
>
>         I have already tried .Select "Parentnodes;Childnodes" but it is not
> working. FYI, I am trying to resolve this thrugh recording.
>
> Browser("Cramer6: deuser @ Cramer62").Page("Cramer6: deuser @
> Cramer62").Frame("ResourceBrowser").JavaApplet("ScriptableResourceBrowserApple_2").JavaApplet("ResourceBrowserApplet").JavaTree("BrowserTreePane$BrowserTree").Select
> "#0;#0
>
>
> 2. I also want to Right Click on the Selected nodes.
>
> 3. I want to check whether the particular nodes is appearing under Javatree
> after creation.
>
> Pls guide asap or let me know the contact no of the person who knows the
> solution. I can give a call for discussion.
>
> Thanks
> Amit
>
>
>
>
>
> On Fri, Nov 5, 2010 at 1:06 AM, bhavin v patel <bhavi...@gmail.com> wrote:
>
>> For JavaTree ,
>> You can first count number of node items using
>> counter=JavaWindow("x").JavaDialog("x").JavaTree("x").GetROProperty("items
>> count")
>> ' you need to spy on object property and find out which method is
>> giving you actual count
>> then using counter
>> ReDim selectItem(coutner)
>> for i=0 to counter-1
>>
>> selectItem(i)=JavaWindow("x").JavaDialog("x").JavaTree("x").getItem(i)
>>   JavaWindow("x").JavaDialog("x").JavaTree("x").Select(selectItem(i))
>> Next
>>
>> you can also directly select item in javatree like
>>     JavaWindow("x").JavaDialog("x").JavaTree("x").Select "any value
>> in node with Hierarchy"
>>
>> for example If you have Javatree like below
>>
>> Your Name
>>    Your First Name
>>        Your Last Name
>>
>> you can select
>>  JavaWindow("x").JavaDialog("x").JavaTree("x").Select "Your Name;Your
>> First Name;Your Last Name"
>>
>> Let me know if you need any more help.
>>
>>
>> On Nov 4, 1:54 pm, Aniket Gadre <aniket....@gmail.com> wrote:
>> > Please elaborate your problem.
>> >
>> >
>> >
>> > On Thu, Nov 4, 2010 at 7:40 PM, Amit <amitvpandey1...@gmail.com> wrote:
>> > > Hi,
>> >
>> > >  Can anyone pls guide me how to select the nodes in Java Tree.
>> >
>> > > Thanks
>> > > Amit
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> > > "QTP - HP Quick Test Professional - Automated Software Testing"
>> > > group.
>> > > To post to this group, send email to MercuryQTP@googlegroups.com
>> > > To unsubscribe from this group, send email to
>> > > mercuryqtp+unsubscr...@googlegroups.com<mercuryqtp%2bunsubscr...@googlegroups.com>
>> <mercuryqtp%2bunsubscr...@googlegroups.com<mercuryqtp%252bunsubscr...@googlegroups.com>
>> >
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/MercuryQTP?hl=en
>> >
>> > --
>> > Best Regards,
>> > Aniket Gadre
>> > Senior SME - Test Automation
>> > Amdocs , Pune.
>> > E-add: aniket.ga...@amdocs.com
>>
>> --
>> You received this message because you are subscribed to the Google
>> "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> To post to this group, send email to MercuryQTP@googlegroups.com
>> To unsubscribe from this group, send email to
>> mercuryqtp+unsubscr...@googlegroups.com<mercuryqtp%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/MercuryQTP?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to MercuryQTP@googlegroups.com
> To unsubscribe from this group, send email to
> mercuryqtp+unsubscr...@googlegroups.com<mercuryqtp%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>



-- 
Best Regards,
Aniket Gadre
Senior SME - Test Automation
Amdocs , Pune.
E-add: aniket.ga...@amdocs.com

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to MercuryQTP@googlegroups.com
To unsubscribe from this group, send email to
mercuryqtp+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to