I started this test by recording steps in QTP. I have several things that I now need to do progamatically.

1. I need to know how to randomly select different "branches" of a tree every time the script is replayed. This script cannot reuse the same customer twice.

2. I need to be able to capture the text in the following line of code:
.SwfTreeView("_customerHierarchyTree").Expand 15
For instance when I recorded this I selected Grape Supply Co Inc (00005555555)in the tree. I will want to write the Customer Number out to an excel spreadsheet so it's value can be used in subsequent scripts.

I've tried a few things so far but so far none of them are providing the Customer Number I want from the tree object I select.

Thanks for any advice you can provide! Susan

Here's my code so far:

'Select the Hierarchy tab on the Price List Profile Search tab in Service Pricing
With SwfWindow("Service Pricing")
.SwfTab("_searchTabCtrl").Select "Hierarchy"

'Expand UPP - ZZZ/WalkMart (UK57)
.SwfTreeView("_customerHierarchyTree").Expand "UPP - ZZZ/WalkMart (UK57)"

'Expand L1 level - L1 08 CIG (0001111111)
.SwfTreeView("_customerHierarchyTree").Expand "UPP - ZZZ/WalkMart (UK57);L1 08 ZZZ (0001111111)"

'Expand L2 level - L2 08 Midwest Region (0002222222)
.SwfTreeView("_customerHierarchyTree").Expand "UPP - ZZZ/WalkMart (UK57);L1 08 ZZZ (0001111111);L2 08 Midwest Region (0002222222)"

'Expand L3 level - L3 08 Midwest Team (0003333333)
.SwfTreeView("_customerHierarchyTree").Expand "UPP - ZZZ/WalkMart (UK57);L1 08 ZZZ (0001111111);L2 08 Midwest Region (0002222222);L3 08 Midwest Team (0003333333)"

'Expand L4 level - L4 08 Texas Team (0004444444)
.SwfTreeView("_customerHierarchyTree").Expand 10

'Expand Grape Supply Co Inc (00005555555)
.SwfTreeView("_customerHierarchyTree").Expand 14

'Expand L6 08 Grape Supply (0006666666)
.SwfTreeView("_customerHierarchyTree").Expand 15

'Select the Customer you will use for the Service Pricing Create Profile script if a message is received "Zero profiles were found based upon the given parameters".
vCust = .SwfTreeView("_customerHierarchyTree").GetROProper ty("Text")

'gets the Customer Number you selected so it can be written to the Reporter later
.SwfTreeView("_customerHierarchyTree").Output CheckPoint("_customerHierarchyTree")
.SwfTreeView("_customerHierarchyTree").Select 16

'If this message is not received and a Profile is displayed, you must loop through the selection process again until the message is displayed. I havenít written the Loop yet.
'You can't use a Customer that has had a profile created in the past.
If .Dialog("App_Manager").Exist Then
Reporter.ReportEvent micPass, "Service Pricing - Find Customer", "Customer <insert Customer Number from output above here> will be used for Import All test"
End If

End With