SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2007
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Setting Environment Variable


    How to set Environment Variable in WinRunner by other than "set" command of DOS. By "set" command WinRunner does not update environment variable information and is required to be restarted.

    Thanks in anticipation.

  2. #2
    Senior Member
    Join Date
    May 2003
    Location
    Austria
    Posts
    1,480
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Setting Environment Variable

    Not sure, if this is the best way to do it, but you could use something like that:
    <font class="small">Code:</font><hr /><pre>
    dos_system("reg add \"HKLM\\System\\CurrentControlSet\\Control\\Sessio n Manager\\Environment\" /v Path /d \"c:\\mypath;c:\\yourpath\" /f");
    </pre><hr />

    I can't assure that the registry key posted in this sample is the same in your environment.

    Regards,
    Juergen

  3. #3
    Member
    Join Date
    Dec 2007
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Setting Environment Variable

    hi juergen!

    Its working, thanks.
    But i am facing an issue regarding launching an application which picks license path from an env variable. when i launch it manually it works fine(picks variable from path given in env variable) but when it is launched through script (invoke_app), it fails to pick license path untill I restart winRunner.
    Is there any other way of invoking application in winRunner?
    OR
    Any workaround to refresh winRunner env variable info?
    OR
    Any other solution to this problem?

  4. #4
    Senior Member
    Join Date
    May 2003
    Location
    Austria
    Posts
    1,480
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Setting Environment Variable

    How does it behave when starting the application with:
    dos_system("start myapplication.exe");

    Or even other solution:
    Write a batch file that sets the environment variable and then starts the application. Then start the batch file from WinRunner (by using invoke_application or the solution I have posted here).

    Regards,
    Juergen

 

 

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:47 PM.

Copyright BetaSoft Inc.