Page 1 of 1

Unable to Select Option from Option Tag

Posted: Fri Jul 20, 2012 3:35 pm
by archana
Ranorex.SelectTag SELECTTAG = "//td[@id='lovTermBlock']/div[@id='lovTermSelect']/select/option[@value='";
SELECTTAG .Click();

Ranorex.OptionTag OPTIONTAG=" //td[@id='lovTermBlock']div[@id='lovTermSelect']selectoption[@value='TESTVALUE']";
OPTIONTAG.Selected = true;

I am not able to selece TESTVALUE from DropDown List..

Please suggest me any way to solve this issue...


Also, I tried with solution provided here :-http://www.ranorex.com/forum/unable-to- ... t3413.html

But still no luck :( :(

Re: Unable to Select Option from Option Tag

Posted: Fri Jul 20, 2012 5:06 pm
by Ciege
What error are you getting?
Is TESTVALUE the actual item in the list you are trying to select or is that a variable?
Anything else you can share to help describe your issue?

Re: Unable to Select Option from Option Tag

Posted: Fri Jul 20, 2012 5:12 pm
by archana
It Is Actual Value from List..

Re: Unable to Select Option from Option Tag

Posted: Fri Jul 20, 2012 6:09 pm
by Ciege
More information related to your issue is still needed...

Re: Unable to Select Option from Option Tag

Posted: Sat Jul 21, 2012 2:47 pm
by archana
Can you please let me know what kind of information do you require ..

Re: Unable to Select Option from Option Tag

Posted: Mon Jul 23, 2012 8:57 am
by Support Team
Hi,
Ranorex.OptionTag OPTIONTAG=" //td[@id='lovTermBlock']div[@id='lovTermSelect']selectoption[@value='TESTVALUE']";
Is this your path to the OptionTag? If yes, there is a '/' missing.
Is @value the right thing to search for?
Which error-message did you get?

Further on, if you use optionTag.selected = true you don't need to click the selectTag first.
Try to list all your optionTags to see what might went wrong:
SelectTag someSelectTag = "yourSelectTagPath";
IList<OptionTag> list = someSelectTag.FindChildren<OptionTag>();

             foreach(OptionTag opTag in list){
                    // Output of all Option Tags
                    Report.Info("OptionTag: "+opTag.InnerText);
                    // Selection of yourTag
                    if(opTag.InnerText=="YourTag")
                    	opTag.Selected= true;
}
Regards,
Larissa
Ranorex Support Team