SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Moderator
    Join Date
    Feb 2001
    Location
    Melbourne
    Posts
    1,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Global headers for frame, testscript,s and test plans

    How can I use a global to change the folder settings for headers in frame files, testscripts, and test plans?

    If I have a large collection of files and want to port them to a new location or PC, how can I get them to recognise the new major file hierarchy and add this into their own headers?

    I have to believe there is a better way than using find and replace statements throughout the tests.

    regards,
    Martin

    ------------------
    "Not every solution was derived to address an obvious problem" - Me (quite recently indeed)

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Global headers for frame, testscript,s and test plans

    Well...

    ...man... once you're there, you're there, but I would never hard code anything as transient as a path to a folder in the include file or script.

    Values like that need to be drawn out of a database or an include file that the script knows to call. I use an ini file and call it for any value that would tie a script to a specific machine or location.

  3. #3
    Moderator
    Join Date
    Feb 2001
    Location
    Melbourne
    Posts
    1,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Global headers for frame, testscript,s and test plans

    That's the thing though. How do I call the ini file? If I use the include file option, how do I tell the script where the include file is?

    Part of the requirement for the current project is that I create suites of tests in SilkTest and that these will be released to the client for their regression testing on future versions when we release the software.

    Waht do I have to do to at least vaguely ensure that the tests will run when they are intslled on the machine (the machines will have the same directory structure as ours).

    Regards,
    Martin

    ------------------
    "Not every solution was derived to address an obvious problem" - Me (quite recently indeed)

  4. #4
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Global headers for frame, testscript,s and test plans

    I'm confused. You said that the machines will have the same directory structures and yet you want the headers change!?


    ------------------

  5. #5
    Senior Member
    Join Date
    Aug 1999
    Location
    Irvine, CA
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Global headers for frame, testscript,s and test plans

    To find out the fully qualified path to the currently executing script use the function GetProgramDir.

    We have many hardcoded paths stored in global variables. All of them are relative to the executing script file. For example:

    string strScriptDir = GetProgramDir()
    string strDataSetDir = "{strScriptDir}..\Data\"



    ------------------
    Matt Gray
    Kofax Image Products
    Matt Gray

  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Global headers for frame, testscript,s and test plans

    Martinh,

    I've attached a couple of files for you. One is some "snips" from a script portability proposal I put together some time ago, and the other is a couple of functions I pulled out of our shared include file.

    To use them, you need an environment variable HoneyBuckeIniPath= in your system environment. This is the path to the place you store your HoneyBucket.ini file.

    The one function is the one you call from your script for ANY variable you want defined independent of the script. It calls into a HoneyBucket.ini file. For example, I want the name of the machine I am testing against. I call String sTargetMachine = GetSetupValue("PrimaryMachine", "MachineName", True) where PrimaryMachine is the section in the ini file to look, MachineName is the value in that section I want, and True means it is required. If that value in the ini file is undefined, my script will punt and record the error in the results file.

    The other function is the one that tells your include file where to find the ini file since this could be different for each user. That is why it is defined as a system environment variable for that particular user's machine.

    I hope this helps. If not, send me an email and we can work through it in more detail.


    [This message has been edited by DJGray (edited 04-06-2001).]

  7. #7
    Moderator
    Join Date
    Feb 2001
    Location
    Melbourne
    Posts
    1,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Global headers for frame, testscript,s and test plans

    Thanks folks (and in particular DJGray),

    That information was very useful. The initial requirement was taht the files go into specific directories on the target machines. Since then the requirement has changed so taht the scripts can be installed with the portable app and therefore run from wherever they were installed.

    DJGray's instructions have helped immensely with achieving this.

    Cheers,
    Martin

    ------------------
    "Not every solution was derived to address an obvious problem" - Me (quite recently indeed)

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 09:22 PM.

Copyright BetaSoft Inc.