I have to automate Login function in qtp for my project following are the conditions:
Enter valid user id and valid password and click on login button
Enter valid user id and Invalid password click on login button
Leave user Id blank and enter valid Password click on login button
Leave User Id and Password field blank and click on Login
Enter Invalid User id and Invalid Password click on login
Please describe how to do this.
thanks in advance
----------------------------- Moderator Comments
I edited this posting to comply with the forum guidelines. Do NOT post requests for offline conversations, or to have scripts and information sent to you offline. Please read and follow the forum guidelines posted at the top of the first page on this forum, before posting another question.
If requests like this netted results, none of us would have to actually do any work. Be realistic and code your own scripts. Then if you get stuck with a specific problem post a question on this forum for help--BUT only after you have FIRST searched the forum for an answer.
If you wait long enough, maybe this is going to work, huh? Here someone has provided the first part of your requested script. Now if you have an "abcd" login ID with a password of "12345" your are starting to cook with gas!
So, just wait on others who might provide this other pieces to the script you requested. There just might really be a Santa Claus after all.
Public Function Login(uid,pwd)
If browser("b").page("p").webButton("Logoff").Exist(2 )
Reporter.ReportEvent micpass, "Login", "Passed"
Reporter.ReportEvent micFail, "Login", "Failed"
Look at this free script growing before our very eyes! Why didn't I think of this before? I have got a very complex script comming up; multi-lang, DB driven. I am going to have to remember to simply post here on the forum and then wait for my script...