Micro Focus QTP (UFT) Forums
General error in Descriptive programming - 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: General error in Descriptive programming (/Thread-General-error-in-Descriptive-programming)



General error in Descriptive programming - sqadri - 04-20-2012

Hi,

Coudl someone please tell me why does this happen. I am trying to read links in a page and then saelect the links. But the script gives me error. Here is the code. It prints and clicks on some links but then gives error at this line: If Instr(SubGroupTag(a).GetROProperty("name"), "80269")Then


Code:
Set ObjSubgroup = Description.Create
ObjSubgroup("micclass").Value = "Link"
            
Set SubGroupTag = GroupInfo.ChildObjects(ObjSubgroup)    
            
sCount = SubGroupTag.Count

Print sCount            
For a=36 To sCount-1
'Print SubGroupLink(a).GetROProperty("name")
wait(5)
If Instr(SubGroupTag(a).GetROProperty("name"), "80269")Then    
Print "====" + SubGroupTag(a).GetROProperty("name")
If Len( SubGroupTag(a).GetROProperty("name")) = 11Then
SubGroupTag(a).Click
End If
wait(5)    
End If
Next

Thanks,
Sqadri


RE: General error in Descriptive programming - sshukla12 - 04-20-2012

Hi,

Please use
Code:
If Instr(SubGroupTag(a).GetROProperty("name"), "80269")>0 Then
Regards,
Sankalp


RE: General error in Descriptive programming - sqadri - 04-21-2012

Hi Sankalp,

It still does not work. Any more suggestions please.

Thanks,
Sqadri


RE: General error in Descriptive programming - sshukla12 - 04-23-2012

Hi,
Give a try with optional parameters also.

Regards,
Sankalp