How do you define an exception i.e TSL ,POP-UP,OBJECT exception in winrunner

Questions by prasu   answers by prasu

Showing Answers 1 - 4 of 4 Answers

Balaji.C

  • Jan 30th, 2006
 

WinRunner enables you to handle the following types of exceptions:Pop-up exceptions: Instruct WinRunner to detect and handle the appearance of a specific window.TSL exceptions: Instruct WinRunner to detect and handle TSL functions that return a specific error code.Object exceptions: Instruct WinRunner to detect and handle a change in a property for a specific GUI object.Web exceptions: When the WebTest add-in is loaded, you can instruct WinRunner to handle unexpected events and errors that occur in your Web site during a test run.-----------------------------------------------------------------------------------------------------------------------POP-UP EXCEPTION---->>A pop-up exception Handler handles the pop-up messages that come up during the execution of the script in the AUT. TO handle this type of exception we make WinRunner learn the window and also specify a handler to the exception. It could be i. Default actions: WinRunner clicks the OK or Cancel button in the pop-up window, or presses Enter on the keyboard. To select a default handler, click the appropriate button in the dialog box.ii. User-defined handler: If you prefer, specify the name of your own handler. Click User Defined Function Name and type in a name in the User Defined Function Name box.----------------------------------------------------------------------------------------------------------------------TSL EXCEPTION---->>A TSL exception enables you to detect and respond to a specific error code returned during test execution.b. Suppose you are running a batch test on an unstable version of your application. If your application crashes, you want WinRunner to recover test execution. A TSL exception can instruct WinRunner to recover test execution by exiting the current test, restarting the application, and continuing with the next test in the batch.c. The handler function is responsible for recovering test execution. When WinRunner detects a specific error code, it calls the handler function. You implement this function to respond to the unexpected error in the way that meets your specific testing needs.d. Once you have defined the exception, WinRunner activates handling and adds the exception to the list of default TSL exceptions in the Exceptions dialog box. Default TSL exceptions are defined by the XR_EXCP_TSL configuration parameter in the wrun.ini configuration file.-----------------------------------------------------------------------------------------------------------------------OBJECT EXCEPTION---->>During testing, unexpected changes can occur to GUI objects in the application you are testing. These changes are often subtle but they can disrupt the test run and distort results.b. You could use exception handling to detect a change in property of the GUI object during the test run, and to recover test execution by calling a handler function and continue with the test execution

  Was this answer useful?  Yes

m.phanindra

  • Feb 10th, 2006
 

the syntax for pop-up,tsl,object and web exceptions are]

define_object_exception ( exception_name, handler, window, object, property [, value] );

define_popup_exception ( exception_name, handler
, window );

define_tsl_exception ( exception_name, handler, return_code [, function ] );

if u want to use these functions first u have to on exception by using

exception_on function

exception_on ( exception );

  Was this answer useful?  Yes

John Amirtham

  • Feb 14th, 2006
 

If you need an example code for the exception handling for a pop-up, look at the script in you mercury winrunner samples\general\popexcp

  Was this answer useful?  Yes

John Amirtham

  • Feb 14th, 2006
 

You can use the Recovery Manager and create a scenarios for each of the options Object event, Popup event or TSL event and what actions need to be taken (to call a handler function/close a window etc) and activate it by default when the event occurs.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions