SelectBox - Index Reset?
Posted: Tue Oct 20, 2015 4:30 pm
I have a "selectbox" object which contains several selections .. for simplicity, we can assume the listed entries contain the values "1", "2", "3", "4", and "5". I use the following C# code to find a particular entry and move to it to "select" the item:
ListItem item = "/container[@caption='selectbox']/listitem[@text='4']";
item.MoveTo();
item.Click();
Now, if I use this same code to find the "3" entry, it isn't found in the selectbox. Is this because I already moved to the index for the "4" entry, so that the next search starts at the "4" entry (which is past the "3" entry)? If so, how should I go about resetting the selectbox index to the first element?
Thanks ... Rick
ListItem item = "/container[@caption='selectbox']/listitem[@text='4']";
item.MoveTo();
item.Click();
Now, if I use this same code to find the "3" entry, it isn't found in the selectbox. Is this because I already moved to the index for the "4" entry, so that the next search starts at the "4" entry (which is past the "3" entry)? If so, how should I go about resetting the selectbox index to the first element?
Thanks ... Rick