I've seen the forum post for dropdown boxes How to select a Option in a Select tag element (Dropdown), but that method isn't working for a standard SelectTag with size > 1 (a listbox as opposed to a dropdown).
Namely, I can click on options within this SelectTag, but only if they are displayed on screen. EnsureVisible() doesn't seem to scroll to these options properly. IF the option is visible, it is properly clicked.
Any suggestions?
Selecting Option element within a SelectTag ListBox (size>1)
Selecting Option element within a SelectTag ListBox (size>1)
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Selecting Option element within a SelectTag ListBox (size>1)
Hi,
Sorry but EnsureVisible() or Focus() method won't work in both Browsers (IE and Firefox), because these browsers don't provide us such a functionality. Maybe we can handle it with java-script or such a workaround in our code. Meanwhile I would suggest you to use the selected property for the OptionTag Element. This ensures that the item is visible in your listbox.
For example:
Peter
Ranorex Team
Sorry but EnsureVisible() or Focus() method won't work in both Browsers (IE and Firefox), because these browsers don't provide us such a functionality. Maybe we can handle it with java-script or such a workaround in our code. Meanwhile I would suggest you to use the selected property for the OptionTag Element. This ensures that the item is visible in your listbox.
For example:
OptionTag optionTagTest = "OptionTagPath"; optionTagTest .Selected = true;Regards,
Peter
Ranorex Team
Re: Selecting Option element within a SelectTag ListBox (size>1)
Thanks for the info, that method works great!
It seems to work for the traditional size=1 SelectTag (dropdown) and size > 1 (listbox) elements.
It seems to work for the traditional size=1 SelectTag (dropdown) and size > 1 (listbox) elements.