I am trying to create a checkpoint on a web page that looks for a text string "Login Failure". This is only a part of the entire text string.
Using Standard Checkpoint, I created:
Code:
Browser("WisdomLogin").Page("WisdomLogin").WebElement("Login Failure.").Check CheckPoint("Login Failure.")
But this step fails no matter what I have tried.
I thought I wshould try GetROProperty but I am not sure how to use this.
Does anyone have a suggestion on what I should try? My end result is to use an If.. Then...ElseIf statement to determine which action to take.
Any thoughts/ideas or suggestions would be great.
L
Hi MV,
Can you please provide the details of your checkpoint: i.e. what all properties it is checking and the detailed result which tells why it is failing.
The checkpoint I was trying to use was a Text Checkpoint and an Image Checkpoint. Neither one seemed to work as I thought. Once I changed to a Standard Checkpoint, all seems to work fine.
Properties, I am not sure which properties you are refering to. Mostly, I am not sure how to find them after I created the checkpoints. In the Text Checkpoint, I ofcourse selected Insert->Checkpoint->Text Checkpoint durring Rec. I highlighted the desired text, see screenshot, and I get
Code:
Browser("WisdomLogin").Page("WisdomLogin").Check CheckPoint("WisdomLogin")
Same steps with the bitmap checkpoint (see attachment)
Code:
Browser("WisdomLogin").Page("WisdomLogin").WebElement("WebElement").Check CheckPoint("WebElement")
Using a standard checkpoint seems to be the only checkpoint that works.
thxxx
Lor
Hi,
You can do that programmatically as well.
Here we go.
Code:
Login_Status=Browser("WisdomLogin").Page("WisdomLogin").WebElement("Login Failure.").GetROProperty("Innertext")
If (Instr(1,Login_Status,"Login Failure")>0) Then
Msgbox "PASS...Required Text String exist"
Else
Msgbox "FAIL...Required Text String not exist"
End if
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.
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