i am new to qtp i do not know how to write script
how to write the code to login if it fails how to able
error messages

Answer Posted / shyam.meghansh

if Dialog("Login").Exist then
Dialog("Login").WinEdit("Agent Name:").Set DataTable
("A",dtLocalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable
("B", dtLocalSheet)
Dialog("Login").WinButton("OK").Click

' Check for invalid user and password
If Dialog("Login").Dialog("Flight
Reservations").Exist Then
Dialog("Login").Dialog("Flight
Reservations").WinButton("OK").Click
Reporter.ReportEvent
micfail,"Login","Invalid User /Pwd Check"
msgbox "Invalid User /Pwd Check"
ExitRun(0)
End If

else
Reporter.ReportEvent
micfail,"Login","Login Dialog not exists"
msgbox "Login Dialog not exists"
ExitRun(0)
end if




................. any more question them let me know.......
mail to testingwithshyam@gmail.com

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I am in .Net development for past 3.5 years and want to enter in to automated testing and learn QTP. For this I need some good tutorial for beginners. I will be really greatful if any one has and they can send it to me on this address- ruchidureja@gmail.com

1449


i have asked earlier only one question how to test web application using QTp plz send me the answer quickly

1632


wht type of User defined functions or Java Releated functions Do we write in VB scripting

1354


How to read a text file from QC using QTP. I would like to do something like this. But instead read a file from QC and NOT from my local drive. Set fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("C:\test.txt", ForReading) Thanks

2725


Can any one say what exact diff between test->parameters, action properties-> parameters. after defining the parameters in test->settings, how can we access those parameters.(i know how to use action prop parameters)

1594






What is qtpro? What is quick test pro?

537


explain abt dyanamic changing object with example?

1880


There is an excel file of 1 to 100 sheets how you will iterate through it?

504


i am looking job in perfomance testing using Loadrunner any one help me a project plz......?(Chandana) chs_29@rediffmail.com

1439


Explain runtime dynamic settings?

2002


I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.

1552


How many tabs are available in debug viewer pane?

619


What is a data driven test in qtp?

555


When Recovery scenario actually starts while testing the application?

1515


Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link

843