with ComboBox, how to open up list or just select an item
Posted: Tue Dec 04, 2007 6:23 pm
Two related questions:
Given a combo box, how do you select an item from the dropdown list without expanding the list?
To avoid location changes, how can you open up the list of items?
Here is what the recorder generated:
However, the use of a location is very dangerous for reuse.
I tried the following in place of ElementFindChildLocation but it returned None.
Am I using the right approach?
Given a combo box, how do you select an item from the dropdown list without expanding the list?
To avoid location changes, how can you open up the list of items?
Here is what the recorder generated:
Code: Select all
control = Ranorex.ControlFindChildControlName(parent, "cboCtsClient")
if control == 0:
return 1
Ranorex.ControlSetFocus(control);
controlElement = Ranorex.ControlGetElement(control)
if controlElement == None:
return 1
element = Ranorex.ElementFindChildLocation(controlElement, 43, "Open", "", 296, 320)
if element == None:
return 1
I tried the following in place of ElementFindChildLocation but it returned None.
Code: Select all
element = Ranorex.ElementFindChild(controlElement, 43, "Open", "WindowsForms10.COMBOBOX.app2", Ranorex.MATCH_SUBSTRING)