SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Advanced Member RKY's Avatar
    Join Date
    Aug 2006
    Location
    Hyderabad, India
    Posts
    586
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Error Handling in QTP


    Everyone,
    Is there any possibilities to get the error occured line no while executing in unattended mode? I hope below is the some of ways to handle in other automation tools

    Rational Robot:

    1. On Error Goto ErrHandler

    - This will be the placed in the beginning of the method and ErrHandler will be placed in End of method. This will gives the quick visiblity of error occured line with err description.

    Rational Functional Tester

    1. Parse the Exception Stack Trace and get the Line #, method name and class name.
    3. Using Try and Catch Block

    How about QTP?

    I hope we cant use On Error Goto ErrorHandler, It supports On Error Resume Next and We cant prediate when error will occur.

    Example:

    After selection of Radio Button, appropriate Select box will be loaded with data. Script will take the data from combo box and proceed the operation. If combobox is not loaded on time, rest of the code will fail.

    Is Recovery Scenario will satify this feature?

    Your comments are highly appriciated. [img]/images/graemlins/laugh.gif[/img] [img]/images/graemlins/wink.gif[/img]

  2. #2
    Junior Member
    Join Date
    May 2008
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Error Handling in QTP

    Try by changing the function structure as given below.
    Check for error number before doing the operation. If no error is present the error number will be 0.Any non 0 number indicates that there are some errors in the execution. hence we can handle the error scenarious in un attented mode.

    Function ABC()

    On error resume next
    'Script Statements to click on Radio button
    'Script statements to select value from Select Box
    'Check error number

    If Err.number <>0 Then
    'Error handling operations or call another function to do it
    'Exit from function
    Else
    'Proceed with the rest of steps

    End If

    End Function

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 7.69%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:37 AM.

Copyright BetaSoft Inc.