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
Not able to select values in SelectTag combobox
-
- Posts: 39
- Joined: Thu Oct 09, 2014 1:15 pm
- Location: Bangalore
Not able to select values in SelectTag combobox
You do not have the required permissions to view the files attached to this post.
Regrads,
Nishant Singh
Nishant Singh
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Not able to select values in SelectTag combobox
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
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
-
- Posts: 39
- Joined: Thu Oct 09, 2014 1:15 pm
- Location: Bangalore
Re: Not able to select values in SelectTag combobox
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
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
Regrads,
Nishant Singh
Nishant Singh
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Not able to select values in SelectTag combobox
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
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
-
- Posts: 39
- Joined: Thu Oct 09, 2014 1:15 pm
- Location: Bangalore
Re: Not able to select values in SelectTag combobox
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
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
Regrads,
Nishant Singh
Nishant Singh
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Not able to select values in SelectTag combobox
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
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
-
- Posts: 39
- Joined: Thu Oct 09, 2014 1:15 pm
- Location: Bangalore
Re: Not able to select values in SelectTag combobox
thanks Markus.
Regards,
Nishant Singh
Regards,
Nishant Singh
Regrads,
Nishant Singh
Nishant Singh