04-21-2011, 07:23 PM
Now that I have my checkpoints working, how can I use them in an If...Then... ElseIf...Else statement?
I have 3 scenerios I must consider. 1, succesfull login screen appears, 2, if the Failure screen apppears and, 3, if (1or 2 not seen) the server is down so exit.
My code so far (but it is not working)
To check which page opened, is the If...Then... statement Ok to use? If so, what am I incorrectly doing?
Or should I not even try checkpoints? If "Text1" then...Else If "Text2" then ... Else ...
Thx
Lor
I have 3 scenerios I must consider. 1, succesfull login screen appears, 2, if the Failure screen apppears and, 3, if (1or 2 not seen) the server is down so exit.
My code so far (but it is not working)
Code:
If Browser("Wisdom CTE").Page("WisdomLogin").WebElement("Login Failure.").Check CheckPoint("Login Failure.").exists Then
'Login Failed
Reporter.ReportEvent micPass, "Login", "Login Failed - Bad User ID or Password"
Browser("WisdomLogin").Close
ElseIf (Browser("WisdomLogin").Page("Wisdom CTE").Image("Wisdom").WaitProperty "visible", True, 3000).exists Then
'Login Passed - Logout only appears when the login is successful
Reporter.ReportEvent micPass, "Login", "Login Passed"
Else
'None of the object exist
Reporter.ReportEvent micFail, "Login", "Login Failed. Unknown error"
Browser("WisdomLogin").Close
End If
To check which page opened, is the If...Then... statement Ok to use? If so, what am I incorrectly doing?
Or should I not even try checkpoints? If "Text1" then...Else If "Text2" then ... Else ...
Thx
Lor