Notes-VBscript with an emphasis on automated testing with UFT-Module 5-Conditional Logic

Just copy and paste these into any word editor of your UFT/QTP in order to analyze the code.
'QTP TUTORIAL
______________________________________________________________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'_____________________________CONDITIONAL LOGIC _______________________________________________
'______________________________________________________________________________________________
'------- NOTES
'------- NOTES
'If statement
 'If {condition that is True} Then
 '{statements}
 'End If
'If {condition that is True} Then
 '{statements}
 'ElseIf {condition that is True} Then
 '{statements}
 'End If
 
'Select Case Statement 
 'Select Case {expression}
 'Case case1
 '
 'Case caseN
 '
 'Case Else
 '
 'End Select
'''------- NOTES END
'''------- NOTES END
'''------- CODE
''''------- CODE
'If weekday(date()) = 2 Then
' msgbox "Today is Monday"
'End If
'
'
'Dim x, y
'x = 69
'y = 1
'If x => 90 Then
' msgbox "You get an A"
'ElseIf x >= 80 and x < 90 Then
' msgbox "You get a B"
'ElseIf x >= 70 and x < 80 Then
' msgbox "You get a C"
'Else
' msgbox "Quit the class you slacker!"
'End If
'
'
'
'Dim x
'x = 70
'x ="some string"
'Select Case x
'Case 90
' msgbox "90"
'Case 80
' msgbox "80"
'Case Else
' msgbox "else part of the case statement"
'End Select
'Case 90 = if x=90 then
'''''------- CODE END
'''------- CODE END

 

Pin It on Pinterest

Clef two-factor authentication