Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to be able to utilize variable in place of hard code in WebRadioGroup

Status
Not open for further replies.

kdjonesmtb2

Technical User
Nov 19, 2012
93
US
Hello

I would like to utilize a Variable in place of a hardcoded value in the WebRadio Group statements below




Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT").WebRadioGroup("htmlid:=rbSelect",Trim(DataTable.Value("Provider_ID","Global"))).select "#0"
This code using an HP QTP Datatable does not work

'Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT").WebRadioGroup("htmlid:=rbSelect","value:=PRV00010317").select "#0"
'This code works with the hard code - The radio button of the row that contains the value above is selected


Dim AffiliationID
AffiliationID=Trim(DataTable.Value("Provider_ID","Global"))

'Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT").WebRadioGroup("htmlid:=rbSelect","value:=(AffiliationID)").select "#0"

This code using a variable also does not work - the Datatable/variable contain the same hardcoded value above

Is there another way to utilize a variable in a WbfGrid statement?




 
Try this:

Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT").WebRadioGroup("htmlid:=rbSelect","value:=[highlight #FCE94F]" & AffiliationID & "[/highlight]).select "#0
 
Hello

Thanks! The only way I could get this to compile in HP QTP was to add an additional (")

See below:

Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT").WebRadioGroup("htmlid:=rbSelect","value:=" & AffiliationID &"" ).select "#0"


However, I am still getting an error: when the code gets to this line

Cannot identify the object "[ WebRadioGroup ]" (of class WebRadioGroup). Verify that this object's properties match an object currently displayed in your application.
Line (109): "Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT").WebRadioGroup("htmlid:=rbSelect","value:=" & AffiliationID &"" ).select "#0"". Failed


My display indicates that the values of the variable is populated

Dim AffiliationID
AffiliationID=Trim(DataTable.Value("Provider_ID","Global"))

print "AffiliationID"
print AffiliationID

Print Results:

AffiliationID
PRV00010316

Thanks!
 
Yes I missed that an additional " was needed. In that case, you have to double up the quotes, which would make THREE " in a row... this should work...

Browser("ABN-NHP-APP-T15 - QNXT").Window("Select Provider by Affiliation").Page("Select Provider by Affiliation").Frame("Frame").WbfGrid("dgAffil_DT").WebRadioGroup("htmlid:=rbSelect","value:=" & AffiliationID & [highlight #8AE234]"""[/highlight]).select "#0"
 
Hello

The solution above compiles with a fourth (") but I am still receiving cannot identify object errors

Is there an alternate method to associate the datatable value?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top