SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Passing variables to Exception Handlers

    User Michael Roux (michael.roux@protective.com.nospam) posted:

    Does anyone know of a way to pass variables to pop-up exception
    handlers
    currently I am declaring a Count variable publicly.
    I am doing this so I know if the exception handler function ran or
    not without having to look at the test results.

    Is there a way to pass the variable into it this way:

    public function Error_1 (in window, inout CountError)
    {
    set_window("Error in Policy Information");
    CountError++;
    static_get_text("Error Message 1 (static)", text);
    report_msg(text);
    button_press("OK");
    }

    I cannot figure this out since WR handles when and how these
    funcitons are called.

    Currently I am able to do this by declaring the CountError
    as extern. But I am told that this is a bad practice.



  2. #2
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing variables to Exception Handlers

    User (michael.roux@protective.com.nospam) posted:


    Hey everyone,
    I think I figured out how to handle this.
    don't use pop-up exception handlers, just test to see if the window (error
    box in this case) appears, if it does just increment the counter if the
    window appers and then close it.

    This creates a question for me
    . Which is the better way to handle this:
    Finding out if a pop up error box(window) has occurred. incrementing a
    counter then closing the error box.?
    Or using public variables and WR built in pop-up exception handling or the
    way described above.

    Also, my first question:
    Can varibles be passed as inout to pop-up exception handler functions in
    WR.

    Thanks,
    Michael
    Please respond to winrunner@yahoogroups.com

    To: winrunner@yahoogroups.com
    cc:

    Subject: [winrunner] Passing variables to Exception Handlers


    Does anyone know of a way to pass variables to pop-up exception
    handlers
    currently I am declaring a Count variable publicly.
    I am doing this so I know if the exception handler function ran or
    not without having to look at the test results.

    Is there a way to pass the variable into it this way:

    public function Error_1 (in window, inout CountError)
    {
    set_window("Error in Policy Information");
    CountError++;
    static_get_text("Error Message 1 (static)", text);
    report_msg(text);
    button_press("OK");
    }

    I cannot figure this out since WR handles when and how these
    funcitons are called.

    Currently I am able to do this by declaring the CountError
    as extern. But I am told that this is a bad practice.

  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing variables to Exception Handlers

    User Teresa Brings (teresa.brings@dig.com.nospam) posted:

    ------_=_NextPart_001_01C14ABB.32BBE900
    Content-Type: text/plain

    From my experience I've had trouble with exception handler reliability and
    will usually just write in code to handle if I know where they will pop up.


  4. #4
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing variables to Exception Handlers

    User Christian Bartel (christian.bartel@gwi-ag.com.nospam) posted:

    Hi Michael!

    You might also use

    WrSetEnvironmentVariable("aktMODUL", "");

    to set Environmentvariables. These will be also known within the exception.

    Greeting,
    Christian


    http://docs.yahoo.com/info/terms/



  5. #5
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing variables to Exception Handlers

    User (michael.roux@protective.com.nospam) posted:


    This is the kind of solution I was looking for.
    Thanks, Christian

    Christian Bartel <christian.bartel@gwi-ag.com> on 10/05/2001 02:55:30 AM

    Please respond to winrunner@yahoogroups.com

    To: "'winrunner@yahoogroups.com'" <winrunner@yahoogroups.com>
    cc:

    Subject: RE: [winrunner] Passing variables to Exception Handlers


    Hi Michael!

    You might also use

    WrSetEnvironmentVariable("aktMODUL", "");

    to set Environmentvariables. These will be also known within the exception.

    Greeting,
    Christian


    http://docs.yahoo.com/info/terms/



  6. #6
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Passing variables to Exception Handlers

    User (JSchwartz@DTCC.com.nospam) posted:

    I don't know about the function WrSetEnvironmentVariable(), but the
    GetEnvironmentVariableA() and SetEnvironmentVariableA() API functions
    are available in kernel32.

    They should be loaded as part of the win32api.

    Jerry



 

 

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 13.64%
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:50 PM.

Copyright BetaSoft Inc.