SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    program location

    I have a program installed under C:\Program Files\ClientApps (x64) or C:\Program Files (x86)\clientApp (x86) folder

    How can I use any build in function to use % parameter to get the program path with (x64) or (x86) as I don't want to use hardcode to define the program path?

    any help?

  2. #2
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: program location

    Do you want to set the program path in code to execute your application? Or do you want to find the application and get the path back? Your question is a little unclear.
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

  3. #3
    Member
    Join Date
    Jan 2008
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: program location

    Yes, I want to find the application path. It depends on the operation system with either 64 bit or 32 bit.
    ie
    C:\Program Files\ClientApps (x64)\client.exe or
    C:\Program Files (x86)\clientApp (x86)\client.exe

    currenlty, I am using the OS info to check 64bit or 32 bit to assign the hard coded application path. I was wondering if there are better/clever ways to get the application path.

  4. #4
    Senior Member
    Join Date
    Aug 2006
    Posts
    1,920
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: program location

    Hi,

    You can use environment variables. For example, you can insert them to the path to your application added in TestedApps either via the editor, or from scripts (see the "TestedApps Editor" and "TestedApp.Path" help topics). Also, you can obtain values of environment variables in scripts by using the aqEnvironment.GetEnvironmentVariable method (see the "aqEnvironment.GetEnvironmentVariable" help topic).
    Jared - AQA Support

  5. #5
    Member
    Join Date
    Jan 2008
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: program location

    Thanks

    I've read the help topic for aqEnvironment. But how can I know the environment variables.

    for example, 'programfiles' variable can be used to the path of program file of 32bit or 64 bit.

    How about other variables? Don't really understand how to define other variables of other program locations.

    C:\Program Files\ClientApps (x64)\client.exe or
    C:\Program Files (x86)\clientApp (x86)\client.exe

    Any help?

  6. #6
    Senior Member
    Join Date
    Aug 2006
    Posts
    1,920
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: program location

    Hi,

    You can either define an environment variable in Windows and keep the path there, or check your system's bitness and generate the path dynamically in a script. For example:
    <font class="small">Code:</font><hr /><pre>...
    // JScript
    var is64bit = false;
    if(Sys.OSInfo.Windows64bit) is64bit = true;
    var path = aqEnvironment.GetEnvironmentVariable("ProgramFiles ", is64bit) + "\\ClientApps ";

    if(is64bit) path += "(x64)\\";
    else path += "(x86)\\";

    path += client.exe;
    ...</pre><hr />
    Jared - AQA Support

 

 

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 10.71%
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 02:15 AM.

Copyright BetaSoft Inc.