SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    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

    Calling from where Script was Opened.

    I keep all my scripts on a thumb drive and depending if manual testing has started or not on that particular machine, when I put in my thumb drive, it can be E:\ or F:\. This can take some time for me to make sure everything in my script and the scripts it calls is changed from E:\ to F:\. I was wondering if there was any way in TSL to call the scripts from the directory the main one is opened from so i dont have to take the time to fix?

    Thanks much in advance,
    Jeric
    Never argue with an idiot, they bring you down to their level and beat you with experience -- Dilbert

  2. #2
    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: Calling from where Script was Opened.

    You can do one of wo things.

    (recommended): Use a const or varaiable to drive the base drive location of the scripts. This would mean a single change would be applied to all scripts.


    (not so recommended): store all additional scripts under the main directory and use
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">getvar(&quot;testname&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">to drive the location of the additional scripts. I don't recommend this way as if you do something in error on the main test (like delete it and create a new one), you lose ALL scripts underneath.
    Insanity: doing the same thing over and over again and expecting different results

  3. #3
    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: Calling from where Script was Opened.

    Jeric:

    Don't trust all your hard work to a Flash Drive !

    Call your scripts using a relative path -

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">eval(&quot;call \&quot;&quot; &amp; getvar(&quot;testname&quot &amp; &quot;\..\Called_Test\&quot;();&quot;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

  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: Calling from where Script was Opened.

    hehe, I backup all my hard work to my actuall computer's hard drive, and then on Visual Source Safe. The thing is with our product is it is a system, not just software. So everytime a new Baseline of our system comes out...there goes my hard drive [img]images/icons/smile.gif[/img] But if a new overlay comes out, i can just patch it.

    Tony, I'll try making it a constant or a variable
    Never argue with an idiot, they bring you down to their level and beat you with experience -- Dilbert

  5. #5
    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: Calling from where Script was Opened.

    Originally posted by Tony Davis:

    (not so recommended): store all additional scripts under the main directory and use
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">getvar(&quot;testname&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">to drive the location of the additional scripts. I don't recommend this way as if you do something in error on the main test (like delete it and create a new one), you lose ALL scripts underneath.
    <font size="2" face="Verdana, Arial, Helvetica">Tony and Jeric - the code I posted will call a subtest within the same directory as your main test. No need to store your subtest in the main test's subfolder (I would never think of doing such a thing). You simply concatenate "\..\" to getvar("testname") which means go up one directory.

  6. #6
    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: Calling from where Script was Opened.

    Hmmm I was going to do something like:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">EDrive = &quot;E:\\WinRunner\\QA_Main\\default.xls&quot; ;
    FDrive = &quot;F:\\WinRunner\\QA_Main\\default.xls&quot; ;
    const Drive = &quot;&quot;;
    rc = ddt_open(EDrive, DDT_MODE_READWRITE);
    if (rc != E_OK &amp;&amp; rc != E_FILE_OPEN)
    {
    rc = ddt_open(FDrive, DDT_MODE_READWRITE);
    Drive = &quot;F:\\&quot;;
    }
    else
    {
    Drive = &quot;E:\\&quot;;
    }
    ddt_close(EDrive);
    ddt_close(FDrive);
    ...
    ...
    ...
    ...
    call Drive &amp;&amp; &quot;winrunner\\Test1&quot;();</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">But i'll try yours. Sounds much simpler

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

  7. #7
    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: Calling from where Script was Opened.

    All you need is this:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">eval(&quot;call \&quot;&quot; &amp; getvar(&quot;testname&quot &amp; &quot;\..\Test1\&quot;();&quot;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

  8. #8
    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: Calling from where Script was Opened.

    dont mind this lol fixed my problem and erased my stupidity [img]images/icons/tongue.gif[/img]

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

  9. #9
    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: Calling from where Script was Opened.

    Jeric:

    I didn't see the post which you deleted.
    Is the eval statement working?

  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: Calling from where Script was Opened.

    I got the eval statement to properly debug, but its not actually calling the next script. Error: Test not found in the search path.

    [ 03-10-2006, 06:32 AM: Message edited by: \- Jeric \- ]
    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 9.38%
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 11:51 AM.

Copyright BetaSoft Inc.