The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Micro Focus/Compuware TestPartner

Pages: 1
amodio
Newbie


Reged: 08/22/12
Posts: 12
select node in a treeview
      #715457 - 08/29/12 02:20 AM

hi there
i know the text of node, and i need to click on it on the treeview
the problem is that the treeview is collapsed
and i cannot find any function of Item to select it
here some code

Code:

Dim trw As TTreeView
Set trw = TreeView("Parent.Caption=Catalogo")

Dim its As TItems
Set its = trw.Items
Dim o As Object
Dim s As String
Dim Indice As Integer

For Each o In its
's = o.Item(1) & ", " & o.Item("Selected")
If o.Item(1) = "Linea Valore+ ISDN" Then
o.Select 'here the problem i want select it
'but select is not a member of Object
End If
Indice = Indice + 1
Next



--------------------
i am a troll
do not take so seriously my posts


Post Extras: Print Post   Remind Me!   Notify Moderator  
Ozone
Newbie


Reged: 06/08/12
Posts: 13
Re: select node in a treeview [Re: amodio]
      #715497 - 08/29/12 08:24 AM

You are very close. To get the items to expand, you can set up a ContentCheck. The CaptureData method of the ContentCheck will expand the nodes.
Code:
   
Dim cc As TContentCheck

Set cc = ContentCheck("contentcheck1")
cc.AttachName = "Parent.Caption=Catalogo"

' Expands the nodes
cc.CaptureData

' Get the Items collection.
Dim its As TItems
Set its = cc.Items

' You can count the items this way.
' TestLog.Comment cc.ItemCount

' Go through each item getting the data.
Dim o As Object
Dim s As String

For Each o In its
's = o.Item(1) & ", " & o.Item("Selected")
s = o.Item(1)

'TestLog.Comment s
If s = "Linea Valore+ ISDN" Then
' Use TextSelect on the Treeview
TreeView("Parent.Caption=Catalogo").TextSelect "Linea Valore+ ISDN"
Exit For
End If

Next

Set cc = Nothing
Set o = Nothing
Set its = Nothing



Post Extras: Print Post   Remind Me!   Notify Moderator  
amodio
Newbie


Reged: 08/22/12
Posts: 12
Re: select node in a treeview [Re: Ozone]
      #715559 - 08/30/12 02:00 AM

thank you
i just fixed
Code:

Set its = cc.Items


to
Code:

Set its = TreeView("Parent.Caption=Catalogo").Items


and now it works!

last question please:
do you know how to retrieve a list of child nodes from node?
and how can i know about the image they have?

--------------------
i am a troll
do not take so seriously my posts


Post Extras: Print Post   Remind Me!   Notify Moderator  
Ozone
Newbie


Reged: 06/08/12
Posts: 13
Re: select node in a treeview [Re: amodio]
      #715620 - 08/30/12 09:32 AM

It would help if you could tell me what the ClassName of the TreeView is. If the TreeView is a .NET application, you could add a .NET Reference to the object and be able to invoke the Methods and Properties directly.

With the TreeViews that we test here, the .CaptureData method of the ContentCheck expands all the nodes. Did it expand all the nodes on your TreeView?

I know of no practical way of obtaining the images used.


Post Extras: Print Post   Remind Me!   Notify Moderator  
amodio
Newbie


Reged: 08/22/12
Posts: 12
Re: select node in a treeview [Re: Ozone]
      #715654 - 08/31/12 01:33 AM

hi, thank you for support
i am a newbie too

In order:
1)my treeview it is not a .NET Application
is a Siebel application
2)No, .captureData does not works with me
i replaced:
"Set its = cc.Items"
to
"Set its = TreeView("Parent.Caption=Catalogo").Items "
and here all the node exapands.

ContentCheck("contentcheck1") seems not working with my application.

--------------------
i am a troll
do not take so seriously my posts


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:  Myrtle, Jim Brennan, AJ, DSquared 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2558

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5