Micro Focus QTP (UFT) Forums
Problem with radio button - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Problem with radio button (/Thread-Problem-with-radio-button)

Pages: 1 2


Problem with radio button - swathi4you - 02-21-2008

Hi
I am a newbie and just joined the forum. please help me on this.

I created a QTP script where the cursor is on 1 radio button by default and i selected another radio button and then continued with the script and ran the script. the error that i get is :

---- Cannot identify the specified item of the WebRadioGroup object. Confirm that the specified item is included in the object's item collection ----

Please advice

Swathi


RE: Problem with radio button - Cecil - 02-21-2008

Hi Swathi,

Try using the option number on the radion button options. For example:
Code:
Browser("Browser").Page("Create an Evaluation Order").WebRadioGroup("EC:rblTemplates").Select "#2"

Cheers
Kathy


RE: Problem with radio button - swathi4you - 02-21-2008

I tried that .. still the problem exists. The line where the error occurs in displayed below. this might give you some idea.

----
Code:
Browser("Identity Theft Prevention").Page("LifeLock - Enrollment").WebRadioGroup("WebRadioGroup").Select "#0"
-----

Please advice ...


RE: Problem with radio button - Cecil - 02-21-2008

Hi Swathi

Is your site radio button name is WebRadioGroup?

Also if you leave the radio button selection as per default when recording, does it run fine after?

Cheers
Kathy


RE: Problem with radio button - swathi4you - 02-21-2008

My radio button name in the website is " choose monthly plan ".
Yes, if I leave the default button as it is and run the script, it runs fine.


RE: Problem with radio button - Ankur - 02-22-2008

For different radio buttons use case select statements...For Ex:

Code:
Dim rb

rb= 1 (say) // you need to parameterize this

Select Case rb
      Case 0     Browser("Identity Theft Prevention").Page("LifeLock - Enrollment").WebRadioGroup("WebRadioGroup").Select "#0"
      Case 1   Browser("Identity Theft Prevention").Page("LifeLock - Enrollment").WebRadioGroup("WebRadioGroup").Select "#1"
    
   End Select



RE: Problem with radio button - swathi4you - 02-23-2008

Hi ...

When i get the message as below :
---- Confirm that the specified item is included in the object's item collection ---- does this mean that i need to add something in the repository or anywhere else before starting the test. Because i tried different codes and scripts and get the same error. So is there anything i need to change / add before starting my test.

Please advice ...

FYI : My company just started with the tools so i am the 1st one using it and this is the first test ever created on this tool here.

swathi


RE: Problem with radio button - newqtp - 02-23-2008

Check that object is in repository.that's why you get the this kind of error.


RE: Problem with radio button - swathi4you - 02-26-2008

I checked the OR ... the object is there. I am trying to attach a screen shot of the OR which has the object properties for your understanding but unable to do so as it says the file size is high.
So i will list out the properties that are there in the OR :
Name :Webradiogroup
Class : Webradiogroup
html tag : input
Type, Value : Index , 1
Enable smart identification :true

Do I need to make any changes to it

Thanks


RE: Problem with radio button - Cecil - 02-26-2008

Hi Swathi,

On the example of I gave you previously, the name of the radio button was taken from doing the view source (of the web page that contain the radio buttons).I.e.

Code:
<input id="EC_rblTemplates_2" type="radio" name="EC:rblTemplates" value="17660683" /><label for="EC_rblTemplates_2">CS-University Course Questionnaire</label>

I copied the value of "name" to WebRadioGroup("EC:rblTemplates"), and for which radio button selected, I use the order of the option, i.e. input id = .... 2 so Select "#2".

Hope that helps.

Cheers
Kathy