Results 1 to 4 of 4
  1. #1

    INI Files vs Global Vars File

    Just curious because I'm in the midst of creating a Global Var files which will be imported through QTP resources. Just wondering when would I use a INI file over a Global Vars file? I'm using the Global Var file to hold different paths to .vbs files and my main excel suite file. Is there an advantage to using one over the other...or are they used for two different reasons. I'm hoping someone can shed some light on this...thanks.

  2. #2

    Re: INI Files vs Global Vars File

    INI files or XML files are used to pass your environment variables accross all tests.
    e.g. of INI
    setting all tests to run on www.QA1.Test.com
    next time you want to run your tests against QA2 you just have to change only QA1 above to QA2.

    hope it is clear?
    "I realize it's an error, but no one is going to try to do that!"
    From "Top 10 Stupid Comments from Developers".

  3. #3

    Re: INI Files vs Global Vars File

    Thanks for the reply, but in scenario you provided couldn't I just declare a constant with the path I wanted in a separate vbs file and include it into the QTP resources and have the same effect? I'm asking because I want to elimate all possible hard coding of paths, especially ones that reference vbs files that are used in ExecuteFile statements.

  4. #4

    Re: INI Files vs Global Vars File

    The scenario, Nadim has provided, can do whatever you need.
    You don't need multiple VBSs for that. Just one. Assosiate it with every test case. And inside of this script read value of SystemUnderTest from INI.
    You would control only this value.
    Only in one file.
    No script, no test cases would be touched if you need to change the system.
    Like that:
    In INI file:
    In VBscript:
    read this value and put it in some variable,
    for example:CurrentSystem

    In TestCases:
    accosiate ExecuteFile "VBscrip.vbs"
    Execute your application with parameter 'CurrentSystem'...

    Just one thing:
    You can not read INI with Environment.LoadFromFile from VBscript as you normaly do from TestCase. You need to read it with External.Declare




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 04:16 PM.

Copyright BetaSoft Inc.