Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If...Then... ElseIf...Else statement
#1
Solved: 11 Years, 4 Months ago
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)

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
Reply


Messages In This Thread
If...Then... ElseIf...Else statement - by mv8167 - 04-21-2011, 07:23 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)