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
SelectBox - Index Reset?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: SelectBox - Index Reset?
Hello volcamp55,
Depending on the technology you are using you can try the following line on the select box element.
Please send a Ranorex Snapshot file from your application.
Regards,
Bernhard
Depending on the technology you are using you can try the following line on the select box element.
repo.Selectbox.Self.Element.SetAttributeValue("SelectedItemIndex", "0")If my suggestions doesn't work we need more information in order to analyze the issue.
Please send a Ranorex Snapshot file from your application.
Regards,
Bernhard
Re: SelectBox - Index Reset?
Thanks for the suggestion, Bernhard. I will try that out when I can gain access to a system that I can test this out on. Basically, I have a web interface to control our system diagnostics. The drop-down lists are contained in "selectbox" web controls. If your suggestion doesn't work, I will send you snapshots of the files.
Thank you again for your help ... Rick
Thank you again for your help ... Rick