SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member
    Join Date
    Sep 2004
    Location
    Pune, India
    Posts
    143
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Web Exception Handling

    Hi All,
    We all face the issue of Web Expceptions very often, this issue affects our execution and crashes our running scripts.

    I want to know if there is any method in which we handle a Web Exception and continue with the same flow as intended.

    Eg. An exception arrises on set_window in following script:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">set_window(&quot;My Window&quot;
    if(web_frame_text_exists(&quot;My Window&quot==E_OK)
    printf(&quot;Pass&quot;
    else
    printf(&quot;fail&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Now say if a security popup window is open because of which "My Window" couldnt be set and an exception is thrown. Even if I use WEB EXCEPTION HANDLERS i will not be able to get WR to start the execution from set_window statement.
    Which will eventually destroy my scripts.

    My point is that in my scripts I have to write
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
    if(win_exists(&quot;Security Win&quot==E_OK)
    {set_window(&quot;Security Win&quot;
    button_press(&quot;OK&quot;}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">on many occasions.

    I want to handle this and other[application specific]types of unexpected windows,record the message and re-execute the statement which gave me the error eg: set_window in case 1.

    I'm sure many of us have faced this issue....
    Any suggestions or solutions will be highly appreciated...
    [img]images/icons/smile.gif[/img]
    Thanks

    [ 06-06-2005, 12:07 AM: Message edited by: Amit Dharkar ]

  2. #2
    Member
    Join Date
    Aug 2003
    Location
    Ohio
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    This is a constant issue for those doing scripts for web based applications. I haven't had the time myself to research in-depth and comprehensive solutions. About the only thing I can offer is that we here at my company have written functions for some of the more common and frequent known (or expected) situation, and placed them in a compiled module. This of course has no other effect than your solution above, except that it cleans up your script file a little. We have some scripts where we need to do this like 10 times, and just calling a function instead of having 3-5 lines of code for each instance makes the script much more manageable.

    If anyone does have some more comprehensive solutions, perhaps that use the exception handler, I would be interested in seeing them as well.

    Regards,

    Todd

  3. #3
    Senior Member
    Join Date
    Apr 2005
    Location
    Sierra Vista
    Posts
    549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    I dont know if this would work, but have you tried a regular pop-up exception?
    Never argue with an idiot, they bring you down to their level and beat you with experience -- Dilbert

  4. #4
    Moderator
    Join Date
    Mar 2002
    Location
    Tampa Bay
    Posts
    7,673
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    Jeric, The problem with using the exception handler is that it is an exit - you can't get back where you came from.

  5. #5
    Senior Member
    Join Date
    Sep 2004
    Location
    Pune, India
    Posts
    143
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    Hi Peter,
    Yes, you are right...
    I already have identified some popup exceptions and some are unidentified, it is just that when they occur I want some exception handler to record the message and handle those Popups and re-execute the line which gave us an Winrunner Error, e.g.: Object not enabled etc....

    I thought that popup exception handler of WR might help but figured out that it only helps for exit scenarios...

    I find Todd's solution intresting, but what about unexpected exceptions, which destroy execution of our scripts specially if we are running Test cases in loop...like 50 Tc's at a time.

    Thanks for your suggestions...
    If someone has more comprehensive solution, it will be highly appreciated...

  6. #6
    Moderator
    Join Date
    Mar 2002
    Location
    Tampa Bay
    Posts
    7,673
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    The nature of WinRunner is such that it isn't designed to continue running after (completely) unexpected occurrences of ANY kind.

    This is a design issue (which you're welcome to take up with Mercury). But in the meantime, your scripts MUST be robust enought to cope with ALL possibilities if you want them to run to completion every time.

  7. #7
    Senior Member
    Join Date
    Sep 2004
    Location
    Pune, India
    Posts
    143
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    Thanks Peter..!!

    We have implemented exception handling already in our scripts...I'll organize the same in one compiled module and call appropriate functions when required....
    I already have designed a rough version of the compiled module and ErrHandling functions... I want to refine them further...

    If I can get a template code for reference for the same, I can develop a more robust Error Handler Module...Plz send it accross if any of you have it...offcourse if you find it ethical...

    Thanks...

  8. #8
    Moderator
    Join Date
    Mar 2002
    Location
    Tampa Bay
    Posts
    7,673
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    An all-purpose exception handler has to be specific to your AUT. No one else's will be of much use to you.

  9. #9
    Senior Member
    Join Date
    Sep 2004
    Location
    Pune, India
    Posts
    143
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    Hi Peter,
    Agreed, but I just wanted to see the way you have written the functions.
    And I'll write my AUT specific error handler accordingly.
    May be your coding style/standard/Design[architechture] be useful for me...

    Awaiting your reply...
    Thanks...

  10. #10
    Moderator
    Join Date
    Mar 2002
    Location
    Tampa Bay
    Posts
    7,673
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Web Exception Handling

    Well, mine won't - I don't use a general-purpose exception handler.

    Now, if you are seeking coding design/standards tips, that is really way off topic for this thread.

 

 
Page 1 of 2 12 LastLast

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 10.71%
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 04:31 AM.

Copyright BetaSoft Inc.