1
votes

I am scripting my application using UFT 12.01.

The issue is I am not able to select a link on the java tree. when I spy it highlights the complete Java dialog box and not any links on the tree.

If I try recording it records using index as select ("0";"0"), but I should get the text to click which currently I am not able to get. Please help me solve this.

Sample line of recording

Browser("XXX").Page("YYY").Frame("contentPane").ActiveX("Java Plug-in 1.6.0_44").JavaApplet("ScheduleEditorViewApplet").JavaDialog("Select Location").JavaTree("*").Select "0;0;1"
1
I suggest you ask this on an appropriate HP form for UTF. Unless you have some Java code to show up... - Peter Lawrey

1 Answers

2
votes

Highlighting the whole tree is not an issue. Object Spy always highlights whole tree object, links inside the tree view are just items.

and for the second question, as it is selecting with Index

  1. get the count of items in Javatree:

itemsCount = CInt(JavaTreeObject.GetROProperty("items count"))

  1. write a for loop with count and get every tree item name:

nodeName = JavaTreeObject.GetItem(i)

  1. if the that tree item name matches your expected value then select that item

JavaTreeObject.Select(nodeName)

nodeName consists of node names separated by ;, e.g.:

"top level node;2nd level node;3rd level node"

N.B.: if the node is collapsed it's children will not be seen by the previous actions (you need to expand it first)!