Forum Discussion

rushikesh's avatar
rushikesh
Contributor
6 years ago

How to expand PopUp tree and select node under it.

Hi,

 

I want to expand popup tree and select a node in it.

Refer attached screen shot for inital state of tree and node to select.

I am using JavaScript, below is the code

 

PopupFeatureTree.ExpandItem("|*  (Default<<Default>_Display State 1>)")
PopupFeatureTree.ExpandItem("|[0]|[0]|[0]|");

PopupFeatureTree.wItems.Item(0).Items.Item(0).Items.Item(0).Items.Item(0).Click()

 

I get error " The tree node cannot be expanded or collapsed.  " for first line of code.

 

If popup tree is in expanded state then error is not observed.

 

How to expand popup tree from initail state?

 

Regards,

Rushikesh Kadam

3 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    What happens when you double click on a Node? if it is expanded then do double to expend the item.

     

    PopupFeatureTree.Item("|*  (Default<<Default>_Display State 1>)").DblClick();

     

    • rushikesh's avatar
      rushikesh
      Contributor

      shankar_r Yes when double click it expands. But at time of test execution, it may be in expand state.

      So if double click it will collopse and error will occur when click on child node.

      • shankar_r's avatar
        shankar_r
        Community Hero

        Try to see your tree item has Expanded / Collapsed property if it has then add a check before double-clicking.