Ask a Question

Expand a list item

Super Contributor

Expand a list item


I want to select a random list from a list of few items and expand it by index.

I wrote a function to get the random list and select it but have some difficulties expanding it.


// Select random action from the actions list
  ActionToSelect = Random(1, Aliases.CCM.MainFrame.ContentControl.StackPanel.Control2.ListBox.wItemCount)


How can I expand the selected list item by index (Dblclick won't work here as the expanding should be perfomed from the expander, triangle icon in this case).



Frequent Contributor


Maxvalue = Aliases.CCM.MainFrame.ContentControl.StackPanel.Control2.ListBox.wItemCount
Log.message ("Maxium Number of Value in the list: " &Maxvalue
//Prevents out of bound
RandomValue = Random(Maxvalue)
Log.message ("Random Value in the list: " &RandomValue

With Regards
Vallalarasu Pandiyan
Esteemed Contributor

Is there a keyboard shortcut for doing the expansion? Like a right arrow or enter or tab?  I think it would be a bit tricky and a lot of code to find the triangle icon you're talking about (at least, sight-unseen not knowing what the component looks like).  I would simply send a "Keys" command to the control once you've selected the item you want and try that short cut.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Showing results for 
Search instead for 
Did you mean: