×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Can WinRunner read Environment variables?

Can WinRunner read Environment variables?

Can WinRunner read Environment variables?

(OP)
I want to allow scripts to run on different machines and hide the local configuration in environment variables (actually, the variables are already set and I want to make use of them).

How can a WinRunner script get the text of an environment variable?

Cheers

RE: Can WinRunner read Environment variables?

(OP)
getenv ( environment_variable );

It's easy, once you already know it. Of course, it would have been easier if the index actually had synonyms!

Cheers

RE: Can WinRunner read Environment variables?

(OP)
AHHHH!!!!!!

It's WinRunner's "environment", not Windows.

Sigh

Cheers

RE: Can WinRunner read Environment variables?

Hi,
 hope this will help you! I am using it and it work No mater where you want to run yourscirpt!


public function setpath (out PATH, inout Work_dir )
{
    auto PATH_1,PATH_2,PATH_3;
    auto i,slash,Work_path,iPath,path_array[] ;
    PATH = "";
    slash = "";
    Work_path ="";
    iPath = split (Work_dir, path_array, "\\");
    for (i=1; i <= iPath; i++)
    {
        Work_path = Work_path & slash & path_array[i] ;
        slash = "\\";
            Work_dir = Work_path ;
    }
    PATH_1 ="<C:\Program Files\Mercury Interactive\WinRunner\samples\bookexmp\lib><.><C:\Program Files\Mercury Interactive\WinRunner\lib>";
    PATH_2 = "<" & Work_dir & "\Directory1>";
    PATH_3 = "<" & Work_dir & "\Directory2>";
    PATH = PATH_1 & PATH_2 & PATH_3;         
}

setpath(PATH,Work_dir);
setvar ("searchpath",PATH);

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close