Micro Focus QTP (UFT) Forums
how to handle login failure in QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: how to handle login failure in QTP (/Thread-how-to-handle-login-failure-in-QTP)

Pages: 1 2


how to handle login failure in QTP - Rohit - 04-06-2011

Hello Guys ,

I need to Test that if all users in the data table can login to the application

on giving the invalid user name or bad password the welcome page is not displayed and Tests fails while giving the object not found error .

How can i handle this that If one ligin gets failed the script go to next iteration


RE: how to handle login failure in QTP - manishbhalshankar - 04-06-2011

Hi Rohit,

You can use recovery scenario to achieve this.


RE: how to handle login failure in QTP - basanth27 - 04-06-2011

(04-06-2011, 03:50 PM)Rohit Wrote: Hello Guys ,

I need to Test that if all users in the data table can login to the application

on giving the invalid user name or bad password the welcome page is not displayed and Tests fails while giving the object not found error .

How can i handle this that If one ligin gets failed the script go to next iteration

Is it a QTP Error or an Application error?

(04-06-2011, 04:02 PM)manishbhalshankar Wrote: Hi Rohit,

You can use recovery scenario to achieve this.

Manish -
From the error "object required" it looks like it is QTP error. Although i am not sure, would wait for the questioner to clarify further. However, assuming it is, i am really curious to know as to how could we apply recovery scenario in this case?


RE: how to handle login failure in QTP - Rohit - 04-06-2011

Its is a qtp error message


RE: how to handle login failure in QTP - basanth27 - 04-06-2011

You can over come the error using,
On Error Resume Next.
However, you will need to consider this valid failure as a case of pass because you are validating scenarios in a pretty awkward way. If i were you, i would rather check for the objects existence than try to find that object which validates the object.


RE: how to handle login failure in QTP - Rohit - 04-06-2011

ok .can You give me an example in form of code that how will you do that? I shall be very thankful to you then .


RE: how to handle login failure in QTP - basanth27 - 04-06-2011

I would be really thankful if you can poste the code you are trying. I will be more than happy to modify that for you.


RE: how to handle login failure in QTP - Rohit - 04-06-2011

Code:
Browser("Browser").Page("Page").WebEdit("login[username]").Set DataTable("UserName", dtGlobalSheet)
Browser("Browser").Page("Page").WebEdit("login[password]").SetSecure DataTable("Password", dtGlobalSheet)
Browser("Browser").Page("Page").WebButton("login").Click


Browser("Browser").Page("Page_2").Link("Overview").Check CheckPoint("welcome")



Browser("Browser").Page("Page_2").Sync
Browser("Browser").Close



RE: how to handle login failure in QTP - basanth27 - 04-06-2011

Where is the error? On the login click or the checkpoint check?


RE: how to handle login failure in QTP - Rohit - 04-06-2011

on checkpoint check