Explain types of exception handling and script for that?

Answers were Sorted based on User's Feedback



Explain types of exception handling and script for that?..

Answer / av

you didn't list the types, seemed it's not quite clear

Is This Answer Correct ?    0 Yes 0 No

Explain types of exception handling and script for that?..

Answer / 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

More QTP Interview Questions

How to handle Dynamic Arrays?

0 Answers   Wipro,


when a test case is written how u test using qtp

0 Answers   Satyam,


we have one text box and one list box(list box appear in same page or another page) what ever the text enter in text box that must be displyed in list box as first one. for example if we enter 10 in text box that is the 1st item in list box . after that we enter 11 then 11 is the 1st item and 10 is 2nd item. the maximum limit of list box is 10 items. if we enter 11th item the 10th item is deleted and llth one is add as 1st one and 9th one goes to 10th position part2:maore than the answer for this question i want the the reason why testers go for this kind of risk.what is the use of we testers having these kind of attempts.is that not the problem with the developer .pls answer .real time users of tools.in which way these solutions help to test with r without affecting the developed souce code.

3 Answers  


What is Virtual Users?

1 Answers   Crea,


How QTP recognizes Objects in AUT?

8 Answers   Blue Star,


HI Everybody, I am using QTP 9.2, I have a problem and hope everybody help me solve it. Now I need to use mouse wheel event to zoom in or zoom out in web client, but QTP can't catch this event. I look forward helping of everybody. Thank you very much.

0 Answers  


What is test object model in quicktest professional?

0 Answers  


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What is the difference between them? How to handle script issues?

0 Answers  


Explain the concept of how QTP identifies object.

5 Answers   Ordain Solutions,


Could i know how how to explain keyword driven framework in interview? If any body knows plz send the explanation.

0 Answers   Fiserv,


IF THE GUI OF APPLICATION IS CHANGED THEN IS THERE ANY NECISSITY TO CHANGE OR UPDATE OUR TEST SCRIPTS

2 Answers  


how can i pass parameters into function?

4 Answers   Livetek,


Categories