The simplest way is to set it directly:
- Code: Select all
SelectTag combo = ...
combo.TagValue = "text";
If there is some javascript wired to it, this might not work, though.
In this case I suggest using the the mouse:
- Code: Select all
SelectTag combo = ...
// open the combo box
combo.Click(Location.CenterRight);
// find the right item in the popup and click it
ListItem item = "/container[@caption='selectbox']/listitem[@text='green']";
item.Click();
This is a bit arcane so we will add some functionality in the SelectTag and OptionTag to simplify this. However, the RanorexRecorder generates code that is similar to the code above.
Michael
Ranorex Support Team