SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    passing parameters back and forth thru Test Scripts

    hi guys... I'm having problems with passing parameters back to a calling test script.
    This is what I have:

    have test script A and test script B.
    Test Script A calls Test Script B, where Test Script B has 4 parameters (3 of them are coming from Test Script A, Test Script B will return one of the parameters, but once I get back from test script B, I'm losing the value from that last parameter, why is that?


    Test Script A
    strUser = "eduardo";
    strpassword = "111";
    strURL = "http://www.test.com";
    call_close Test Script B (strUser, strpassword, strURL, strDatabase);
    # note here that strDatabase will come from inside Test Script B, After calling Test Script B, strDatabase value is empty, I don't know if it is possible to pass a parameter back to the parent script.

    ================================================== ======

    Test Script B (All these parameters are declared on Test Properties)
    if strURL == ""http://www.test.com"
    {
    strDatabase = "sqlserveruat1";
    }
    ================================================== ======

  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: passing parameters back and forth thru Test Scripts

    I do not believe you can do it that way. You would probably want to do it:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"># script A:
    strUser = &quot;eduardo&quot;;
    strpassword = &quot;111&quot;;
    strURL = &quot;http://www.test.com&quot;;
    strDatabase = call_close &quot;script B&quot; (strUser, strpassword, strURL);</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica"></font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"># script B:
    if strURL == &quot;&quot;http://www.test.com&quot;
    {
    strDatabase = &quot;sqlserveruat1&quot;;
    }
    treturn(strDatabase);</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Depending on what you are trying to do, making Script B a function (probably within a compiled module) might be better. Then you could define strDatabase and an "out" parameter and use a syntax similar to your original example.
    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)

  3. #3
    Junior Member
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: passing parameters back and forth thru Test Scripts

    Charles,
    I took your advice and I decided to convert my script into a function, it works perfectly

    THANKS
    eg

 

 

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 04:25 PM.

Copyright BetaSoft Inc.