I have been using Ranorex to test on IE7 and 8 and have had no problem selecting items from combo boxes. However I am now using the same code to look at IE6 and it won't work:
selectItem(SelectTag selectName, string itemToSelect)
{
selectName.Focus();
selectName.Click();
ListItem listItem = "/container[@caption='selectbox']/listitem[@text='" + itemToSelect + "']";
listItem.Select();
listItem.Click();
}
Combo boxes in IE6
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Combo boxes in IE6
Hi,
in IE6 the structure of the selectbox differs to the one of IE7 and IE8.
So in IE6 the structure looks like: Container->List->ListItem
And in IE7/8 it looks like: Container->ListItem
To make your code work for both IE6 and IE7/8 you have to change your path to following:
ListItem listItem = "/container[@caption='selectbox']//listitem[@text='" + itemToSelect + "']";
Kind regards,
Tobias
Support Team
in IE6 the structure of the selectbox differs to the one of IE7 and IE8.
So in IE6 the structure looks like: Container->List->ListItem
And in IE7/8 it looks like: Container->ListItem
To make your code work for both IE6 and IE7/8 you have to change your path to following:
ListItem listItem = "/container[@caption='selectbox']//listitem[@text='" + itemToSelect + "']";
Kind regards,
Tobias
Support Team
-
- Posts: 31
- Joined: Mon Jan 10, 2011 1:05 pm
Re: Combo boxes in IE6
Thanks for this - problem solved.