Micro Focus QTP (UFT) Forums
Setting the value based on link existence - 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: Setting the value based on link existence (/Thread-Setting-the-value-based-on-link-existence)



Setting the value based on link existence - joncfrazier - 05-15-2012

If a link exist, I want to set the value of an object?

This is what I have:

Code:
Iteration = DataTable.GlobalSheet.GetCurrentRow
If  Browser("...").Page("...").Link("...").Exist (1)=True Then Object1= 1 Else Object1 = 0 End If

If Object1 = 1 Then
<-------snip------->
ElseIf Iteration = 5 Then
<-------snip------->
End If
End If

If Object1 = 0 Then
<-------snip------->
ElseIf Iteration = 5 Then
<-------snip------->
End If
End If

When running the code, it seems sto stop, without error, after the existence check, i.e. none of the "if object1 = 1/0" lines run.

What am I doing wrong here?

Iterations = 0 if not parameterized therefore the if statements never = 1/2/3/4/5