Explain types of exception handling and script for that?

Answer Posted / shyam prasad

' Script :: Login
' Date ::
' Input Values :: dtable,text,mydate
'Last Modified ::

Option explicit
Dim dtable,text,mydate,url
url="C:\Program Files\Mercury Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe"
mydate=(mid(date,1,6)& right(date,2)) 'For Current Date Use
this statement
'mydate=(right(date,2)& mid(date,3,4)& right(date,2))
'datatable.GlobalSheet.AddParameter "Date", mydate
'datatable.Value(1,1)=mydate
datatable.Import("C:\Documents and
Settings\Shyam\Desktop\QTP_Script\User_Login\From.xls")
datatable.Import("C:\Documents and
Settings\Shyam\Desktop\QTP_Script\User_Login\To.xls")
'datatable.Import("C:\Documents and
Settings\Shyam\Desktop\QTP_Script\User_Login\Agent_Name.xls"
)
'datatable.Import("C:\Documents and
Settings\Shyam\Desktop\QTP_Script\User_Login\Password.xls")
' INVOKE The Login

'datatable(2, dtGlobalSheet)= url
SystemUtil.Run(url)

'Check Login exist
if dialog("Login").Exist then
'dialog("Login").WinEdit("Agent Name:").Set DataTable
("Agent_Name", dtLocalSheet)
'dialog("Login").WinEdit("Password:").Set DataTable
("Password", dtLocalSheet)
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 if
else
Reporter.ReportEvent
micfail,"Login","Login Dialog not exists"
msgbox "Login Dialog not exists"
ExitRun(0)

end if
Reporter.ReportEvent micdone,"Login","Login Sucessfull"

' Enter the order information
window("Flight Reservation").WinButton
("Button_NewOrder").Click
window("Flight Reservation").ActiveX("MaskEdBox").Type
Datatable("Fdate")
window("Flight Reservation").WinComboBox("Fly
From:").Select Datatable



...............
Any more question mail me testingwithshyam@gmail.com

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are some test assets and related extensions of qtp?

551


For which type of projects the iterative model is not suitable?

1433


write script for bitmap image?

1534


In qtp, how you can exit for loop?

523


what is vmodel?advantages and disadvantages of vmodel?

1612






How does qtp recognize objects in aut?

580


What are the types of object repositories? Which one is you are using?

628


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

1429


For example you are checking bit map check point before coming to the results. How can you say it is passed? Or failed? Anyways?

612


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

1582


what is the diff between manual test plan document and automation test plan doc.can u explain indetail.

1640


What will be happen if i load object repository at run time, but it has already associated.

1255


Tell me about your project? please help me how to tell about insurance project

1531


Give me some real time point of way where exactly we can conduct audits?

1497


Explain the Different types of QTP test assets and their extensions?

603