ah ... it is doing exactly what you are asking it to do.
You need to put Exit For just after the pass condition. Something like this -
You need to put Exit For just after the pass condition. Something like this -
Code:
Function VerifyHistory()
Dim funcName : funcName = "VerifyHistory"
Dim setupFuncName : setupFuncName = "SETUP|" & funcName
rowcnt = Browser("Br").Page("Pg").WebTable("Tbl").Rowcount
For i = 2 To rowcnt
actual= Browser("Br").Page("Pg").WebTable("Tbl").GetCellData(i,4)
If Instr(parameter.Item("Activity"),actual)>0 Then
ResultOutput "Pass", "Expected:"¶meter.Item("Activity")&vbnewline,"Actual: "&actual
Exit For
else
ResultOutput "fail", "Expected:"¶meter.Item("Activity")&vbnewline,"Actual: "&actual
End If
Next
End Function
Want to fast track your QTP/UFT Learning? Join our UFT Training Course