Thursday 14 March 2013

Types of the Environment Variables in QTP

QTP has basically 2 types of environment variables.

  • Built in - e.g OS - operating system information - This is read only
  • User Defined - User can define his own variables - This can be edited or modified.
User defined variables can be loaded from external variables as well. When you load it from the external file, Variables can not be edited.

To create user defined variables, you have to go to the settings of the test and click on environment Tab.
Select variable type as "User defined". Then add any variable and it's value.

Example -


'Create environment variable at runtime -
Environment.Value("MyDirectory") = "c:\test"



Environment.LoadFromFile "c:\Env.ini"   ' Load varaibles from ENV.ini

Format of ini file should be like this -

[Environment]
 
   var1=abcd
   var2=xyz

[Environment]

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.