Page 1 of 1
Not able to select values in SelectTag combobox
Posted: Thu Jan 01, 2015 3:28 pm
by NishantSingh
Hi,
I am using Ranorex studio 5.2.0, windows 7 OS and Mozilla Firefox 33
On a webpage from a combobox (SelectTag) i have to select a specific value but I am not able to do it.
PFA the snapshot.
please help me out
Regards,
Nishant Singh
Re: Not able to select values in SelectTag combobox
Posted: Fri Jan 02, 2015 2:00 pm
by Support Team
Hi Nishan,
May I ask you how you tried to select the specific SelectTag?
By the way, could you also update to the latest Ranorex version, which is Ranorex 5.2.1?
Here is the link:
Ranorex 5.2.1.
Thanks,
Markus
Re: Not able to select values in SelectTag combobox
Posted: Sat Jan 03, 2015 8:44 pm
by NishantSingh
Hi Markus,
I have tried this piece of code
Ranorex.SelectTag selectCountry = "/dom[@domain='
www.amazon.in']//select[#'enterAddressCountryCode']";
selectCountry.Click();
ListItem selectCList = selectCountry.FindSingle<ListItem>("Option[@innertext = '" + strCountry + "']");
selectCList.Click();
but this is not working as the container don't have any List I checked with the Spy.
Again I have tried by modifying this piece of code which I found in your support forum
foreach (OptionTag option in DOMCombo.Find(".//option"))
{
if (option.InnerText == ComboItem)
{
ComboItemFound = true;
break;
}
but these are nit working so Finally I have to use this
RepObj.AmazonSite.EnterAddressCountryCode.Element.SetAttributeValue("TagValue", strCountry);
RepObj.AmazonSite.AddressType.Element.SetAttributeValue("TagValue", strAddressType);
to make it working but it is using the Tag value and I want to use Innertext value to select an option
please let me know if you can help me on this.
Regards,
Nishant Singh
Re: Not able to select values in SelectTag combobox
Posted: Mon Jan 05, 2015 10:57 am
by Support Team
Hi Nishan,
The last code is the right one, from what I can see there is just the possibility to change the TagValue of the specific select tag and this is also the recommended way.
Regards,
Markus
Re: Not able to select values in SelectTag combobox
Posted: Mon Jan 05, 2015 6:35 pm
by NishantSingh
Hi Markus,
So only using Tag Value I can set the dropdown value and not by using innertext of the dropdown value ?
Ok thanks..
Regards,
Nishant Singh
Re: Not able to select values in SelectTag combobox
Posted: Wed Jan 07, 2015 2:32 pm
by Support Team
Hi Nishan,
This always depend on the specific select tag and how it was implemented, but in case of this select tag you need to use the TagValue, right.
Regards,
Markus
Re: Not able to select values in SelectTag combobox
Posted: Wed Jan 14, 2015 7:23 pm
by NishantSingh
thanks Markus.
Regards,
Nishant Singh