Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
After Login, need to check if correct
#1
Not Solved
I created a login script, but I also want to check 3 things 1) Failed loggin (due to bad password) 2) Or that the web app actualy loaded 3) Or a succesful loggin. The first two should exit the test, while the 3rd continues on.

But, even when the test succesfully logs in, I get a warning message about the Login Failure. Am I using the wrong If-Then loop? I only want one of the three actions to take place.

Error Merssage:

The "Login Failure." object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.

Line (12): "If var_Exist = Browser("WisdomLogin").Page("WisdomLogin").WebElement("Login Failure.").Exist Then".

Tip: If the objects in your application have changed, the Maintenance Run Mode can
help you identify and update your steps and/or the objects in your repository.

My code:

Code:
Browser("WisdomLogin").Page("WisdomLogin").WebEdit("userid").Set "17871"
Browser("WisdomLogin").Page("WisdomLogin").WebEdit("password").SetSecure "4d9f2f8fc89871c32e204eec390cef6c84e1ef19756a5b30"
Browser("WisdomLogin").Page("WisdomLogin").WebButton("Log In").Click

If var_Exist = Browser("WisdomLogin").Page("WisdomLogin").WebElement("Login Failure.").Exist Then
      'Login Failed
         Reporter.ReportEvent micPass, "Login", "Login Failed - Bad User ID or Password"
       Browser("WisdomLogin").Close
ElseIf var_Exist = 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"  
Else
       'None of the object exist
      Reporter.ReportEvent micFail, "Login", "Login Failed. Unknown error"
        Browser("WisdomLogin").Close
End If
Reply


Messages In This Thread
After Login, need to check if correct - by mv8167 - 04-15-2011, 02:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation Login & logout in Siebel and clicking pop-up button yuetling926 7 10,727 07-09-2014, 10:43 PM
Last Post: hhamilton
  Unable to Click on Login Button Paurav 1 3,168 07-03-2014, 05:27 AM
Last Post: supputuri
  for help.Run a test to login,and then it didn't jump to another page maosilu 0 2,592 11-01-2013, 01:27 PM
Last Post: maosilu
  The recorded text output not appear on the correct row on the results datatable trance07 0 2,189 09-25-2013, 08:05 PM
Last Post: trance07
  Best method to test Login validation defcon3 2 3,458 05-29-2012, 04:02 PM
Last Post: defcon3

Forum Jump:


Users browsing this thread: 1 Guest(s)