Micro Focus QTP (UFT) Forums
Can you please help me in QTP DP to pass the variable name - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Can you please help me in QTP DP to pass the variable name (/Thread-Can-you-please-help-me-in-QTP-DP-to-pass-the-variable-name)



Can you please help me in QTP DP to pass the variable name - anshika.agarwal - 09-04-2014

Hi,

I am trying to pass the variable name in the property for below:
I am using a loop here as the property name =
applicant[0].alsoAssured changes everytime when I am creating a new applicant for the same proposal so what I am doing is the following:

Code:
app = 0

.WebRadioGroup(name:=applicant["&app&"].alsoAssured")

this is with the loop of 0 to 3.

QTP does not recognise this and throws an error "Cannot identify the object "[ WebRadioGroup ]" (of class WebRadioGroup). Verify that this object's properties match an object currently displayed in your application."


Can anyone please help how to pass the variable name.

Thanks in Advance.


RE: Can you please help me in QTP DP to pass the variable name - anshika.agarwal - 09-04-2014

Sorry I was wrong it looks like QTP doesnt like passing [] in the property value
it failed for the following also:
Code:
.WebRadioGroup(name:="applicant[0].alsoAssured")

I was using a regular expression as [] here and to user the bracket directly I changed this to \[\] and it worked .. Sorry if anyone's time was wasted.
My script is working now.