Subscribe by Email


Saturday, September 1, 2012

What are the types of Exception available in Win Runner? How do you handle an Exception in WinRunner?


In this article, we talk about the various kinds of exceptions available in winrunner and how to handle them. Basically 4 types of exceptions are available in winrunner and they have been mentioned below:
  1. Pop up exceptions
  2. Object exceptions
  3. TSL exceptions and lastly
  4. Web exceptions
Web exceptions are available only if you have installed the web add- ins.

How are different types of exceptions are handled in WinRunner?

- A pop up exception handler is provided in the wirunner package for handling the pop up exceptions that often show up during the execution of the test scripts during the running of acceptance user test.  
- Winrunner can be made to handle pop ups by making it learn the window and by specifying a handler for the exception. 
- These handlers can be:
  1. User defined handlers: The names of these handlers can be specified by clicking on the user defined function name and changing it according to your own will.
  2. Default actions: Winrunner makes its own choice whether to press ok or cancel option. The desired default handler can be selected in the dialog box.
What if your batch test is executing up on a highly unstable version of the software system or application? 
- Obviously it will crash and you would want to recover the test execution. 
- This is possible only through the TSL exceptions which help in the test recovery by instructing the winrunner to exit the current test and restart the application.
- The winrunner can be easily instructed upon how an unexpected event or error can be handled that may occur in the testing environment while you test your web site. 
Here now we explain how to handle such exceptions. 
- Whenever you load some web test add in, the winrunner can be very well instructed up on how a particular exception can be handled that occurred during a test run in your web site. 
- The simplest example that can be given is of the security alert dialog box that some times appears during the test run. 
- The user can resume the normal testing by clicking on the yes button of the security alert dialog box. 
- All the exceptions that are supported by the winrunner are mentioned in a list and can be viewed in the web exception editor.
- This list can be modified and additional exceptions that you want the winrunner to support can be configured and added to the list. 
- All the new exceptions are to be added to the list of exceptions stored in the web exception editor. 
- You need to go down to the tools menu and select the option of web exception handling.
- This opens the web exception editor. 
- There is a pointing hand, clicking on that adds a new exception to the list. 
- For categorizing the exception you need to select a category in the type list. 
The MSW_class, message and title of the exception are displayed by the editor.
- There is an action list available which provides you the options for carrying out the following execution:
  1. Web_ exception_ handler_ dialog_ click_ default: For activating the default button.
  2. Web_ exception_ handler_ fall_ retry: For reloading the web page as well as activating the default button.
  3. Web_ exception_ enter_ user name_ password: For using the given user id and password.
  4. Web_ exception_ handler_ dialog_ click_ yes: For activating the yes button.
  5. Web_ exception_ handler_ dialog_ click_ no: For activating the no button.
- The other operations that can be carried out in winrunner up on exceptions are defining, modifying, activating and deactivating them. 


No comments:

Facebook activity