SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Dec 2001
    Location
    Redditch, Worc\'s UK
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Restarting the application

    Example running a batch test containing say 5 scripts.When the AUT crashes a window appears(Program Error)with an Ok button and a message

    Run the test:

    Script 1 Ok
    Script 2 Ok
    Script 3 the AUT Crashes
    Script 4
    Script 5

    What I am after is that after the window Program Error has been detected
    and the OK button pressed on Script 3. We want to be able to STOP the
    batch from carrying on recover the AUT( start the AUT again ) then carry
    on with Script 4.

    I have created my own user defined function to press the Ok button on the window Program Error(this works fine)

    Can I add into the user defined function the restarting of the AUT after the Ok button has been pressed.

    ------------------
    Andy
    Andy

  2. #2
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Restarting the application

    Andy, are you using the WinRunner exception handler to catch the error, or are you checking for the "crash" window within the actual script (no. 3)?

    If the latter, you should be able to do something like:

    if(win_exists("crash") == E_OK) {
    set_window("crash");
    buttonpress("OK");
    invoke_application(app,etc....);
    treturn(FAIL);
    }

    I'm not sure if treturn() would work if invoked from an exception handler function. Anyone?

    ------------------
    Charles Reace

    charles{DOT}reace{AT}verizon{DOT}net
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

  3. #3
    Senior Member
    Join Date
    Dec 2001
    Location
    Redditch, Worc\'s UK
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Restarting the application

    I am using WinRunner exception handler to catch the error, having tried a few things out it now seems to work see below(not sure this is the correct way but)

    public function checkerror (in Programerror)
    {
    static app_path;
    exception_off("catcrash");
    set_window("Program Error");
    button_press("OK");
    exception_on("catcrash");
    app_path="c:\\Program Files\\ecommerce";
    invoke_application(app_path &"\\catalog.exe","",app_path,SW_SHOW);
    # Software Authorization Key
    set_window ("Software Key", 1);
    button_press ("Bypass");

    # License warning
    set_window ("License warning", 0);
    button_press ("OK");

    # Business
    set_window ("Business", 1);
    button_press ("OK");

    texit;
    }
    In the batch test the crash takes place in script 3 then restarts the AUT texits and carrys on with script4




    ------------------
    Andy
    Andy

  4. #4
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Restarting the application

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Andyc:
    ...having tried a few things out it now seems to work see below(not sure this is the correct way but)...
    <HR></BLOCKQUOTE>
    If it ain't broke, don't fix it.


    ------------------
    Charles Reace

    charles{DOT}reace{AT}verizon{DOT}net
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.&lt;/i] (The Song of Roland)

 

 

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 11.54%
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 02:23 PM.

Copyright BetaSoft Inc.