Posts: 240
Threads: 38
Joined: Jun 2009
Reputation:
0
11-10-2009, 10:13 AM
Hi All,
Could you please explain with some sort of examples.....
If possible please provide some test data also.
Thanks,
Venkat.Batchu
Posts: 240
Threads: 38
Joined: Jun 2009
Reputation:
0
11-10-2009, 09:47 PM
Hi All,
with some R&D and am giving some of my understandings
Please let me know wheter this one is right or not
Error Handling means:
Which means we might be knowing where the error will comes in such situation we can handle those errors
Exception Handling means:
We will not be knowing when errors will come but using recovery scenario's we will be showing some of exceptions and this will be triggered whenver this exception will throws...
Please correct me if am wrong...
Thanks,
Venkat.Batchu
Posts: 20
Threads: 8
Joined: Oct 2009
Reputation:
0
11-10-2009, 09:49 PM
hi venkatbatchu,
As per me we use error handling for expected error behavior of the application. Like in Flight reservation application, we have to validate that "If user click on OK button on Login dialog then error message(in dialog box- Please enter agent name) should display", same for 3 character error message and blank password and wrong password. We know that system should display that type of error. But we have to run our script for that we use error handling through (recovery scenario).
And we use exception handling for dynamic change in our application. Like Fax order. We also used to perform it through Regular expression.
Please let me know if i am worong?
I am not 100% sure for my ans. I request Ankur and Saket to look on this. This is very nice question.
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
11-11-2009, 10:16 AM
Error is an expected situation in your Script. For example, Consider a situation where you specified a divided by zero in your script logic, and the script throws an error. So you will need to handle this wherever your logic expects.
Where as exception is a runtime error that the AUT might encounter during the execution of your script.
For example you are trying to login into your application and application throws an error for database connectivity lost or something like Connection closed or license expired. These are exceptions which are unpredictable errors during runtime.
So in my opinion error handling is to put your logic to handle an expected error in your script and eception handling is to handle an unexpected error thrown by application /script at runtime.
Posts: 350
Threads: 2
Joined: Mar 2008
Reputation:
0
11-11-2009, 01:49 PM
Hi ,
Here is the bottomline.
Predictable Errors --> Error handling ( By using "On Error Resume Next")
Unpredictable Errors --> Exception Handling (By using "[color]Recover Scenario Manager Wizard[/color]")
Posts: 10
Threads: 4
Joined: Nov 2018
Reputation:
0
12-11-2018, 05:11 PM
Exceptions and Errors fall into three categories: checked exceptions, unchecked exceptions, and errors.
Checked Exceptions
Checked by the compiler at compile time
Methods that throw checked exceptions must indicate so with throws which must propagate up the calling stack until the exception is handled
Checked exceptions require explicit catching with a catch block
These include exceptions of the type Exception, except for RuntimeException and its subtypes
Unchecked Exceptions
Not checked at compile time by the compiler
Occur during runtime due to programmer error (i.e. out-of-bounds, divide by zero, etc.) or system resource exhaustion
These do not have to be caught (as they are not checked, they only are known when they occur)
Methods may throw unchecked exceptions but do not have to indicate so in declaration
These are exceptions and subtypes of RuntimeException
Errors
Errors are typically unrecoverable and present serious conditions
Errors are not checked at compile time and do not have to be (but can be) caught or handled