Search:     Advanced search

Expanding and Collapsing Tree Nodes in Scripts

Article ID: 796  |  Last updated: 23 Dec, 2014

If you expand and collapse nodes to select an item in a tree control during recording, a Select statement is added to the script. This statement includes all of the nodes that were expanded or collapsed to select the item. The following example shows a Select statement that selects an item in a tree control.

Window("Browse For Folder").Tree("tree1").Item("Desktop/My Documents/My Pictures/Desktop wallpaper/blue").Select()

If you want to expand or collapse each node individually to test the tree control, you can replace the Select statement with the Expand or Collapse statements. During playback, each statement expands or collapses one node in the tree control. The following example shows several Expand statements that select the same item as the previous example.

Window("Browse For Folder").Tree("tree1").Expand("Desktop")

Window("Browse For Folder").Tree("tree1").Expand("My Documents")

Window("Browse For Folder").Tree("tree1").Expand("My Pictures")

Window("Browse For Folder").Tree("tree1").Expand("Desktop Wallpaper")

Window("Browse For Folder").Tree("tree1").Expand("blue")

Article ID: 796  |   Last updated: 23 Dec, 2014
tree node expand collapse

Prev   Next
Changing the Global Repository Data Directory and Port     Cannot Connect to a Global Repository Hosted on Windows Vista