04-21-2011, 09:10 PM
Thx Chilam, I will need to look into this code more to understand the ongoings.
I have three issues I need to look for. 1, if the page has a Failure due to a bad password/ID, 2, succesfull logiin, 3, if neither is seen the server must be down so Exit.
I have the below code working except the ElseIf statement (ElseIf Browser("Wisdom CTE").Page("WisdomLogin").WebElement("text:=Login Failure.").Exist Then
'Login Failed) does not see the test "Login Failure". My check points sees the text, just not the ElseIf statement. If within the broweser I find the text "Login Faiklure., then Exit. (Later I will add code to get the next Password in a table.)
ALSO.... Which is correct Exist or Exists? I see a lot of people using both. For me, the word Exists turns bold/blue but fails my script when I use it.
I have three issues I need to look for. 1, if the page has a Failure due to a bad password/ID, 2, succesfull logiin, 3, if neither is seen the server must be down so Exit.
I have the below code working except the ElseIf statement (ElseIf Browser("Wisdom CTE").Page("WisdomLogin").WebElement("text:=Login Failure.").Exist Then
'Login Failed) does not see the test "Login Failure". My check points sees the text, just not the ElseIf statement. If within the broweser I find the text "Login Faiklure., then Exit. (Later I will add code to get the next Password in a table.)
ALSO.... Which is correct Exist or Exists? I see a lot of people using both. For me, the word Exists turns bold/blue but fails my script when I use it.
Code:
If Browser("WisdomLogin").Page("Wisdom CTE").Image("Wisdom").Exist Then
'Login Passed - Logout only appears when the login is successful
Reporter.ReportEvent micPass, "Login", "Login Passed"
ElseIf Browser("Wisdom CTE").Page("WisdomLogin").WebElement("text:=Login Failure.").Exist Then
'Login Failed
Reporter.ReportEvent micPass, "Login", "Login Failed - Bad User ID or Password"
Browser("WisdomLogin").Close
Else
'None of the object exist
Reporter.ReportEvent micFail, "Login", "Login Failed. Unknown error"
Browser("WisdomLogin").Close
End If