I record simple action for a treeview control, so I select node, Right-Click on it and once context menu opens, I click on one line in it.
Code, generated by QTP/UFT through recording – don't work
SwfWindow("MyWin").SwfWindow("MyTree").SwfTreeView("myTreeV").RightClick "\\M\\c\\config\\all\\items"
SwfWindow("MyWin").SwfWindow("MyTree").SwfTreeView("myTreeV").SelectMultiple ""
SwfWindow("MyWin").SwfWindow("MyTree").SwfTreeView("myTreeV").Expand "\\M\\c\\config\\all\\items"
SwfWindow("MyWin").SwfWindow("MyTree").SwfTreeView("myTreeV").Select "\\M\\c\\config\\all\\items"
SwfWindow("MyWin").SwfToolbar("SwfToolbar").Select "POS Item Number Maintenance"
Correct code after my edit (moved "Right-Click"line and deleted unnecessary code/script runs fine even without it) – works fine
SwfWindow("MyWin").Activate
SwfWindow("MyWin").SwfWindow("MyTree").SwfTreeView ("myTreeV").Select "\\M\\c\\config\\all\\items"
SwfWindow("MyWin").SwfWindow("MyTree").SwfTreeView ("myTreeV").RightClick "\\M\\c\\config\\all\\items"
SwfWindow("MyWin").SwfToolbar("SwfToolbar").Select "POS Item Number Maintenance"