Selecting Option element within a SelectTag ListBox (size>1) : Object Identification and Technologies

Selecting Option element within a SelectTag ListBox (size>1)

Technology specific object identification, supported applications, web technologies, and 3rd party controls.

Selecting Option element within a SelectTag ListBox (size>1)

Postby mrusso » Tue Aug 02, 2011 1:38 am

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?
Attachments
SelectBoxHeight10.rxsnp
example SelectTag
(154.27 KiB) Downloaded 24 times
mrusso
 
Posts: 16
Joined: Thu Feb 03, 2011 1:54 am

Re: Selecting Option element within a SelectTag ListBox (size>1)

Postby Support Team » Tue Aug 02, 2011 11:37 am

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:
OptionTag optionTagTest = "OptionTagPath";
optionTagTest .Selected = true;


Regards,
Peter
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Selecting Option element within a SelectTag ListBox (size>1)

Postby mrusso » Tue Aug 02, 2011 5:43 pm

Thanks for the info, that method works great!

It seems to work for the traditional size=1 SelectTag (dropdown) and size > 1 (listbox) elements.
mrusso
 
Posts: 16
Joined: Thu Feb 03, 2011 1:54 am


Return to Object Identification and Technologies

Who is online

Users browsing this forum: No registered users and 0 guests