SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    SQA Knight
    Join Date
    Sep 2001
    Location
    Bangalore,India
    Posts
    2,549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    call statement pbm

    Hi,
    Recently I have faced one pbm in my script. I have passed full path value into the call statement (WinRunner 7.01). I'm using sTestName variable to give test script path. After executing my script it gives error. Error message is "Error: Test not found in the search path". Please verify following snippet.

    #### start code###########
    if (sTestName != "") {
    #sTCName = sTestName;
    if (index(sTestName, ":\\") !=0 ) {
    sTCName = sTestName;
    } else {
    sTCName = sCurDir & "\\" & sTestName;
    }

    iTemp = file_open(sTCName & "\\script",FO_MODE_READ); #To check file availability
    if (iTemp == E_OK) {
    file_close(sTCName & "\\script");
    report_msg( sTCName & " - script is going to be executed...");
    call sTestName();
    }
    #### End code###########


    The problematic line is ==> call sTestName();
    This statement is working, if I use the hard code values. But while using variable, it doesn't work.

    Please help me in this pbm.

    ------------------
    Thanks & Regards,
    Palani.
    Thanks & Regards,
    Palani.
    http://tips-testing.blogspot.com/index.html
    Quote: Donít hesitate to initiate!

  2. #2
    SQA Knight
    Join Date
    Sep 2001
    Location
    Bangalore,India
    Posts
    2,549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: call statement pbm

    User tmpalaniselvam (palanigroups@yahoo.com.nospam) posted:

    Hi,
    Recently I have faced one pbm in my script. I have passed full path value into the call statement (WinRunner 7.01). I'm using sTestName variable to give test script path. After executing my script it gives error. Error message is "Error: Test not found in the search path". Please verify following snippet.

    #### start code###########
    if (sTestName != "") {
    #sTCName = sTestName;
    if (index(sTestName, ":\\") !=0 ) {
    sTCName = sTestName;
    } else {
    sTCName = sCurDir & "\\" & sTestName;
    Thanks & Regards,
    Palani.
    http://tips-testing.blogspot.com/index.html
    Quote: Donít hesitate to initiate!

  3. #3
    Senior Member
    Join Date
    Mar 2002
    Location
    Irvine, CA 92606 USA
    Posts
    384
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: call statement pbm

    First problem.
    Missing "}" at end of code.

    This is ugly but does what you want.

    # Use 2 Variables since "eval" needs 2 extra "\"
    sTestName1 = "C:\\WinRunner\\tmp\\aaa\\";
    # eval requires 2 extra back slash ...
    sTestName2 = "C:\\\\WinRunner\\\\tmp\\\\aaa\\\\";

    #### start code###########
    if ( sTestName1 != "" )
    {
    #sTCName = sTestName;
    if (index(sTestName1, ":\\") != 0 )
    {
    sTCName = sTestName1;
    }
    else
    {
    sTCName = sCurDir & "\\" & sTestName1;
    }

    #To check file availability
    iTemp = file_open ( sTCName & "script", FO_MODE_READ );

    if (iTemp == E_OK)
    {
    rc1 = file_close(sTCName & "script");
    report_msg( sTCName & " - script is going to be executed...");


    eval ( "call \"" & sTestName2 & "\" ( );" );
    }
    #### End code###########
    }

    wait (999); # Place Break Point here ...
    # This will keep the Watch List alive ...


    ------------------
    cranem451 - cranem@addendum.com

  4. #4
    Member
    Join Date
    Jun 2001
    Location
    Noida
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: call statement pbm

    User Rajesh Balachandran (rajesh.balachandran@india.birlasoft.com.nospam) posted:

    Palani,

    Use the following code instead of just call statement in the last line
    Rajesh Balachandran

  5. #5
    SQA Knight
    Join Date
    Sep 2001
    Location
    Bangalore,India
    Posts
    2,549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: call statement pbm

    Hi,
    =================
    Originally posted by cranem451:
    First problem.
    Missing "}" at end of code.

    This is ugly but does what you want.

    # Use 2 Variables since "eval" needs 2 extra "\"
    sTestName1 = "C:\\WinRunner\\tmp\\aaa\\";
    # eval requires 2 extra back slash ...
    sTestName2 = "C:\\\\WinRunner\\\\tmp\\\\aaa\\\\";

    #### start code###########
    if ( sTestName1 != "" )
    {
    #sTCName = sTestName;
    if (index(sTestName1, ":\\") != 0 )
    {
    sTCName = sTestName1;
    }
    else
    {
    sTCName = sCurDir & "\\" & sTestName1;
    }

    #To check file availability
    iTemp = file_open ( sTCName & "script", FO_MODE_READ );

    if (iTemp == E_OK)
    {
    rc1 = file_close(sTCName & "script");
    report_msg( sTCName & " - script is going to be executed...");


    eval ( "call \"" & sTestName2 & "\" ( );" );
    }
    #### End code###########
    }

    wait (999); # Place Break Point here ...
    # This will keep the Watch List alive ...
    =======================
    Now it is working fine. Thanks a lot for your help. I try to call all tests from a excel sheet and I have implemented commented option also... I have to implement to get all results from each test and to update in that excel sheet.


    ------------------
    Thanks & Regards,
    Palani.
    Thanks & Regards,
    Palani.
    http://tips-testing.blogspot.com/index.html
    Quote: Donít hesitate to initiate!

 

 

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 07:46 PM.

Copyright BetaSoft Inc.