SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Abort Script run-time with a message

    Hi all,

    I wanted to abort script execution if I encounter a particular value in a parameter, after displaying an error message and close the script.

    In Short, Can I stop execution and close the scripts, even if Winrunner is restarted there is nothing like it.

    Can I do this... !

    Thanks in Advance.
    ---------------------------
    Siva Kumar

  2. #2
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Abort Script run-time with a message

    1) Download PsKill from System Internals and copy it inside your compiled module test folder.

    2) Add the following function to your compiled module:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">function self_destruct()
    {
    auto file = getvar(&quot;testname&quot &amp; &quot;\\self_destruct.bat&quot;;
    file_open(file,FO_MODE_WRITE);
    file_printf(file,&quot;\&quot;&quot; &amp; getvar(&quot;testname&quot &amp; &quot;\\pskill.exe\&quot; wrun.exe\r\n&quot;
    file_printf(file,&quot;\&quot;&quot; &amp; getvar(&quot;testname&quot &amp; &quot;\\pskill.exe\&quot; crvw.exe\r\n&quot;
    file_printf(file,&quot;\&quot;&quot; &amp; getvar(&quot;testname&quot &amp; &quot;\\pskill.exe\&quot; ntvdm.exe&quot;
    file_close(file);
    dos_system(&quot;\&quot;&quot; &amp; file &amp; &quot;\&quot;&quot;
    }</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">3) Call the function to halt execution and shut down WinRunner.

  3. #3
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Abort Script run-time with a message

    sysinternals rules!

    I use a handfull of their applications to expand my testing functionality
    Insanity: doing the same thing over and over again and expecting different results

  4. #4
    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: Abort Script run-time with a message

    In the TSL Online Reference Guide, please look up texit. Code looks like the following.

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">texit ( [ expression ] );</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Note: The texit statement is not a function. Therefore, it does not appear in the Function Generator.'

    I simply use
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">texit;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">for exiting the whole thing

    The nice thing about this is that it halts execution as if your test ended properly and brings up the test results. Plus you dont have to exit winrunner

    [ 03-08-2006, 06:55 AM: Message edited by: \- Jeric \- ]
    Never argue with an idiot, they bring you down to their level and beat you with experience -- Dilbert

  5. #5
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Abort Script run-time with a message

    Hi all,

    I will tryout all these solutions...! Which not even remotely i had any clue of!

    Thanks guys!
    ---------------------------
    Siva Kumar

  6. #6
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Abort Script run-time with a message

    Siva:

    You've been posting here for years - you should know the texit command by now. Even Jeric knew that one and he's only 17 years old.

  7. #7
    Member
    Join Date
    Mar 2003
    Location
    Pune, Maharashtra, India
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Abort Script run-time with a message

    Hi bpolitzer,

    Thats true, this actually slipped my mind, infact I had actually used this in one of my script way back. That was real stupid of me to forget it.

    And in fact, QAForum has become my knowledge repository that first I search here very extensively and only then I start thinking over any issue. Even if I could not make any breakthough I finally go ahead ask you guys.

    You guys have been incredible and makes most of our life easy.

    Thanks guys for all your efforts.
    ---------------------------
    Siva Kumar

  8. #8
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    Location
    St. Louis - Year 2025
    Posts
    15,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Abort Script run-time with a message

    Originally posted by bpolitzer:
    ...Even Jeric knew that one and he's only 17 years old.
    <font size="2" face="Verdana, Arial, Helvetica">Is one not required to be 18 years of age to be drafted into the "Any monkey can do it" business?

    [img]images/icons/smile.gif[/img]

  9. #9
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Abort Script run-time with a message

    21 in some states as well.

    and if you think about that, it makes sense as if you double 21, you get 42!
    Insanity: doing the same thing over and over again and expecting different results

  10. #10
    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: Abort Script run-time with a message

    HEY! I'm 19! Jeesh...almost 20
    Never argue with an idiot, they bring you down to their level and beat you with experience -- Dilbert

 

 
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.00%
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 01:44 PM.

Copyright BetaSoft Inc.