Please let me know how to make UFT to click on the non-selected RB.

1,572 views
Skip to first unread message

Rash

unread,
Aug 16, 2013, 6:47:00 PM8/16/13
to mercu...@googlegroups.com
In the application for some option there is binary answer – Yes, NO with Raido buttons.

Scenario:
When the user navigates to the screen, by default one of the RB will be selected. UFT can identify this RB which is default-selected. But fails to identify the one which is not selected. Even the SPY will not work on it. If tried to click on non-selected RB, it will fetch the property of the RB which is selected.

Please let me know how to make UFT to click on the non-selected RB.

Thanks!

udayanem

unread,
Aug 17, 2013, 4:44:27 AM8/17/13
to mercu...@googlegroups.com
Hi Rash,

For Radio buttons, generally they are grouped and given one name.
Ex: Select Gender:  o Male
                              o Female

Here Male and Female are grouped under Select Gender object.

So the right way of using is.

B().p().webradiogroup().select "Male"       'for selecting Male
B().p().webradiogroup().select "Female"   ' for selecting Female

If it doesnt solve your problem, can you please post the image of the Spy and the code snippet you tried.

Thanks,
Uday
QTP \ UFT Videos

suman ch

unread,
Aug 20, 2013, 8:53:44 AM8/20/13
to mercu...@googlegroups.com
Hi,

You can get the selected item by using GetROProperty("selected item index"). Get all the items using GetROProperty("all items"). Then u can select the required item by providing the Index.

Regards,
Suman Ch


--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
 
---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

uma mahesh

unread,
Aug 21, 2013, 2:08:01 AM8/21/13
to mercu...@googlegroups.com
Try to use index for radiogroup like 

b(b).p(p).webradiogroup("name").set "#1"

Regards
Uma Mahesh

Anish Pillai

unread,
Aug 21, 2013, 2:45:55 PM8/21/13
to mercu...@googlegroups.com
Rashmi,

QTP doesnt consider the object as many separate radio button objects.. It considers the set of all the buttons as a "Radio Button Group'. This is why when you try to select a different radio button, it points back to the same one..

Selecting the particular radio button from the group can be done based upon the index or its value...



Regards,
Anish Pillai
My QTP Blog

Uttmesh Shukla

unread,
Aug 21, 2013, 2:50:19 PM8/21/13
to mercu...@googlegroups.com

It can be done wth help of index. Not sure how we can use value here.

Regards,
Uttmesh shukla

mar raj

unread,
Aug 25, 2013, 9:51:52 AM8/25/13
to mercu...@googlegroups.com
hi u can use

b(b).p(p).webradiogroup("name").select "#1"

vimmi walia

unread,
Aug 26, 2013, 1:49:08 AM8/26/13
to mercu...@googlegroups.com
Hi,

Can you find the name of the radio button. If no u can open the application in Firefox and with the help of firebug can check the name and other properties of the radio button.

After getting the name in qtp you can use descriptive. Programming or html dom to select the radio button as follow -


Set document = browser("browsername").page("page name").object

Set objradio = document.getElementsByName(radiobuttongroupname").item(0)

Objradio.checked = true

Thanks & regards
Vimmi

Mohan Gummadi

unread,
Aug 26, 2013, 2:38:18 PM8/26/13
to mercu...@googlegroups.com
Hi
 
I have a solution if this radio group is embedded in a webtable of the html page.
 
Spy on the radio group and identify the parent webtable.
 
In General, All the radio buttons in a group are arranged in webtable rows. Please identify the correct row and column numer
 
Use ChildItem method to operate them
 
Thanks
Mohan

senthil a

unread,
Sep 14, 2016, 7:23:03 AM9/14/16
to QTP - HP Quick Test Professional - Automated Software Testing

Back end Html Code

<input name="ctl00$MainContent$shopScheduler$Form$RepeatFrequency" id="ctl00_MainContent_shopScheduler_Form_RepeatFrequencyYearly" type="radio" value="RepeatFrequencyYearly">

 

Find xpath:

//input[@id=’ctl00_MainContent_shopScheduler_Form_RepeatFrequencyYearly’]

 

Values:

RepeatFrequencyYearly

 

Syntax:

B().p().webradiogroup(“xpath:=//input[@id=’ctl00_MainContent_shopScheduler_Form_RepeatFrequencyYearly’]”).select " RepeatFrequencyYearly"

Reply all
Reply to author
Forward
0 new messages