Unable to Select Option from Option Tag

Ask general questions here.
archana
Posts: 12
Joined: Fri Jan 06, 2012 2:14 pm

Unable to Select Option from Option Tag

Post by archana » Fri Jul 20, 2012 3:35 pm

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 :( :(

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Unable to Select Option from Option Tag

Post by Ciege » Fri Jul 20, 2012 5:06 pm

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?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

archana
Posts: 12
Joined: Fri Jan 06, 2012 2:14 pm

Re: Unable to Select Option from Option Tag

Post by archana » Fri Jul 20, 2012 5:12 pm

It Is Actual Value from List..

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Unable to Select Option from Option Tag

Post by Ciege » Fri Jul 20, 2012 6:09 pm

More information related to your issue is still needed...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

archana
Posts: 12
Joined: Fri Jan 06, 2012 2:14 pm

Re: Unable to Select Option from Option Tag

Post by archana » Sat Jul 21, 2012 2:47 pm

Can you please let me know what kind of information do you require ..

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Unable to Select Option from Option Tag

Post by Support Team » Mon Jul 23, 2012 8:57 am

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
.
Image