06-21-2011, 11:21 AM
Hi Lorena,
Please see if below approach helps you:
I doubt the way you are looping through excel because for looping through excel is done using "Usedrange".
An alternate way can be by importing the excel file into global sheet in qtp and then running the loop on datatable.
Regards,
Parminder
Please see if below approach helps you:
Code:
For r = 2 to rNumber
'DocView
ReportType = ObjExcel.Cells(r,3)
'Href
Hreff = ObjExcel.Cells(r,4)
href_app=Browser("Wisdom").Page("Wisdom IA_2").Frame("parent").WebTable("Select All").ChildItem(r,4,"Link",0).GetROProperty("href") 'Use this approach if elements in the application are in same order as in the excel file otherwise use another loop For loop for table
name_app=Browser("Wisdom").Page("Wisdom IA_2").Frame("parent").WebTable("Select All").ChildItem(r,4,"Link",0).GetROProperty("innertext")
If href_app= Hreff and name_app=ReportType Then
Browser("Wisdom").Page("Wisdom IA_2").Frame("parent").WebTable("Select All").ChildItem(r,2,"Link",0).Click
Else
Reporter.ReportEvent micFail, "Link is not present at appropriate position","Step Failed"
End If
Next
I doubt the way you are looping through excel because for looping through excel is done using "Usedrange".
An alternate way can be by importing the excel file into global sheet in qtp and then running the loop on datatable.
Regards,
Parminder