On Error Handling In Qtp
Object Repository Descriptive Programming Regular Expression Error Handling & Recovery Scenario Output Values Database Connections Automation Object Model Synchronization Environment Variables XML Outlook Reporting Defect
Contact Us info@qtpworld.com +91- 9886477710 Error Handling & Recovery Scenario Recovery Scenario: When executing scripts we may get some Unexpected errors.To recover the test and continue running script from these unexpected errors we use Recovery Scenarios. What happens in Recovery Scenarios? A recovery scenario consists of the following: Trigger Event: The event that interrupts your run session. For example a window that may pop up on screen. Recovery Operations: The operations to perform to enable QTP to continue running the test after the trigger event interrupts the run session. For example, clicking an OK button in a pop-up window. Post-Recovery Test Run Option: The instructions on how QTP should proceed after the recovery operations have been performed, and from which point in the test QTP should continue. For example, you may want to restart a test from the beginning, or skip a step entirely and continue with the next step in the test. Recovery scenarios are saved in recovery scenario files having the extension .qrs. A recovery scenario file is a logical collection of recovery scenarios, grouped according to our specific requirements. Recovery scenario manger can handle following four events: 1. Pop-up window: To handle unwanted pop ups. 2.Object state: To handle object related errors at runtime. 3. Test run error: To handle vb script statement errors at runtime. 4. Application crash: To handle crashed applications at runtime. 1.Recovery Scenario for Popup Window: Steps to follow to handle unwanted popups: Trigger Event Steps: Resources Menu -->Recovery Scenario Manager -->New -->Next -->Select “Popup Window” as Trigger event -->Next -->Click on Hand Icon -->Show unwanted window with Hand icon -->Next -->Next -->(Continue below mentioned steps) Recovery Operations steps: Select function call as Recovery Operation -->Next {Open Notepad -->Save empty file with .vbs extension} -->Browse the .vbs fie path -->Next -->Uncheck Add another Recovery Operation -->Next -->(Continue below mentioned steps) Post-Recovery Test Run Option Steps: Select Post-Recovery Test Run Option {Repeat current step and continue, Proceed to Next step, Proceed to Next Action, Proceed to next test iteration, Restart current test run, Stop the Test Run} -->Next -->Enter Scenfor UFT > Internet Explorer Support for UFT Chrome Support for UFT Mozilla Firefox Support for UFT Safari & Netscape Support for UFT MS Virtual Machine with Support for UFT ALM Support for UFT Forum Contact Error Handling in UFT 9/3/2015 0 Comments Error Handling in UFTUnexpected events during a test run disrupt a test or may give invalid test results. For example, during a test run, an application error may occur. This http://www.qtpworld.com/index.php?cid=68 error does not permit the automated test to navigate to the feature, screen, or module that needs to be tested. These unexpected errors and events are called exceptions.It becomes important to handle these exceptions so that we are able to continue with automated testing even in unattended mode. Handling of exception in a manner http://testingservicesautomation.weebly.com/error-handling-in-uft/error-handling-in-uft so that test execution is uninterrupted is known as error handling.Following are the ways in which error handling can be implemented in QTP. A.Error handling thru VB SCRIPTING 1.Using Test Settings 2.Using On Error Statement 3.Using Err Object Properties 4.Using Exit StatementB.Recovery ScenarioA.Introduction toError Handling using VBscript in QTP:Test Settings: Error Handling Error Handling can be definedin Test Settings through File>Settings>Run as shown below: It defines the possible actions in caseanerror is encountered during run session Using On Error StatementOn Error statement, which informs theVBScriptengine of intention to handle errors by self, rather than to allow theVBScriptengine to display a typically uninformative error message and halt the program. This is done by inserting a statement like the following at the start of a procedure: • On Error Resume Next: On Error Resume Nexttells theVBScriptengine that, should an error occur, we want it to continue executing the program starting with the line of code
« Previous 1 ... 46 47 48 49 50 ... 68 Next » Difference between error handling and exception handling Thread Rating: 0 http://www.learnqtp.com/forums/Thread-Difference-between-error-handling-and-exception-handling Vote(s) - 0 Average 1 2 3 4 5 Thread Modes Difference between error handling and exception handling venkatbatchu Member Posts: 240 Threads: 38 Joined: Jun 2009 Reputation: 0 #1 https://sumeetkushwah.com/2014/08/12/implementing-try-catch-functionality-in-qtpuft/ 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 Find Reply jsknight1969 Member Posts: 128 on error Threads: 9 Joined: Oct 2009 Reputation: 0 #2 11-10-2009, 09:07 PM I'm not sure of the technical difference, but I believe they are just a difference in languages. VBScript/ASP is an Error object. Other languages that are object oriented (.NET, C++, Java) (3GL) use an exception object for errors. VBScript example Code: on error resume next
a = 1/0
on error handling if err.number <> 0 then
msgbox err.description
end if VB.NET example Code: Try
a=1/0
Catch (ex as exception)
msgbox ex.message
End Try C# Code: try
{
a=1/0
}
catch (exception ex)
{
msgbox ex.message
} The exception is more powerful. It is also not dependent on the vague and often odd Microsoft Error codes to trigger a handle condition. For example, you can actually test for an exception of type System.IO.Exception instead of trying to case all the -214XXXXX error codes. Hope this helps. Find Reply venkatbatchu Member Posts: 240 Threads: 38 Joined: Jun 2009 Reputation: 0 #3 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 showin