kdjonesmtb2
Technical User
Hello,
I am trying to select a radio button using a htmlid value stored in a datatable as the radio button to select
When there are only two radio buttons the following code works
Browser("ABN-NHP-APP-T15 - QNXT").Page("ABN-NHP-APP-T15 - QNXT_2").Frame("Frame").WebButton("Next Step").Click
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgClmNetwork_DT").WebRadioGroup("htmlid:=rdbSelect").WaitProperty "attrribute/readyState","complete",4000
'
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgClmNetwork_DT").WebRadioGroup("htmlid:=rdbSelect","value:=" & AffiliationID).select "#0"
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay- To Affiliation_2").Page("Select a Pay- To Affiliation").Frame("Frame").WebButton("htmlid:=btSelect").WaitProperty "enabled","true",4000
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WebButton("Select").Click
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WebButton("Select").mictab
When there are more than two radio buttons I attempted to use this code but it is not selecting the radio button
Initialize variables
Dim oDescRadio
Dim oChildren_Tier
Dim RadioToSelect_Value
Dim i
'Create description using Description.Create build-in method
Set oDescRadio = Description.Create
oDescRadio("micclass").value = "WebRadioGroup"
oDescRadio("type").value = "radio"
oDescRadio("htmlid").value="rdbSelect" ' use XML spy to get/confirm name
'oDescRadio("name").value="AF1000046401 " 'use XML spy to get/confirm name
'Pass the description in another variable using ChildObjects method
Set oChildren_Tier = Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgClmNetwork_DT").ChildObjects ("oDescRadio")
'Set oChildren_Tier = Browser("ABN-NHP-APP-T15 - QNXT").Page("ABN-NHP-APP-T15 - QNXT").ChildObjects (oDescRadio)
'Loop to select desired value
For i = 0 to oChildren_Tier.Count - 1
RadioToSelect_Value = oChildren_Tier(i).GetROProperty("value")
if RadioToSelect_Value = AffiliationID then
oChildren_Tier(i).Select RadioToSelect_Val
end if
print i
print "RadioToSelect_Value"
print RadioToSelect_Value
'print AffiliationID
Next
The application I am using is HP QTP and it utilizes vbscript
I am trying to select a radio button using a htmlid value stored in a datatable as the radio button to select
When there are only two radio buttons the following code works
Browser("ABN-NHP-APP-T15 - QNXT").Page("ABN-NHP-APP-T15 - QNXT_2").Frame("Frame").WebButton("Next Step").Click
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgClmNetwork_DT").WebRadioGroup("htmlid:=rdbSelect").WaitProperty "attrribute/readyState","complete",4000
'
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgClmNetwork_DT").WebRadioGroup("htmlid:=rdbSelect","value:=" & AffiliationID).select "#0"
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay- To Affiliation_2").Page("Select a Pay- To Affiliation").Frame("Frame").WebButton("htmlid:=btSelect").WaitProperty "enabled","true",4000
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WebButton("Select").Click
Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WebButton("Select").mictab
When there are more than two radio buttons I attempted to use this code but it is not selecting the radio button
Initialize variables
Dim oDescRadio
Dim oChildren_Tier
Dim RadioToSelect_Value
Dim i
'Create description using Description.Create build-in method
Set oDescRadio = Description.Create
oDescRadio("micclass").value = "WebRadioGroup"
oDescRadio("type").value = "radio"
oDescRadio("htmlid").value="rdbSelect" ' use XML spy to get/confirm name
'oDescRadio("name").value="AF1000046401 " 'use XML spy to get/confirm name
'Pass the description in another variable using ChildObjects method
Set oChildren_Tier = Browser("ABN-NHP-APP-T15 - QNXT").Window("Select a Pay-To Affiliation_2").Page("Select a Pay-To Affiliation").Frame("Frame").WbfGrid("dgClmNetwork_DT").ChildObjects ("oDescRadio")
'Set oChildren_Tier = Browser("ABN-NHP-APP-T15 - QNXT").Page("ABN-NHP-APP-T15 - QNXT").ChildObjects (oDescRadio)
'Loop to select desired value
For i = 0 to oChildren_Tier.Count - 1
RadioToSelect_Value = oChildren_Tier(i).GetROProperty("value")
if RadioToSelect_Value = AffiliationID then
oChildren_Tier(i).Select RadioToSelect_Val
end if
print i
print "RadioToSelect_Value"
print RadioToSelect_Value
'print AffiliationID
Next
The application I am using is HP QTP and it utilizes vbscript