Please ensure to include your code between [code][/code] tags while asking or replying to questions.

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

programming to use different external file of environment variables

01-18-2012, 01:11 AM (This post was last modified: 01-18-2012 01:14 AM by bundfromnj.)
Post: #1
Not Solved programming to use different external file of environment variables
Hi,
We have an established QTP framework. We use text files (initialization files ) to set our environment variables. To run my test scripts for a particular application - I attach my variable text file through File>Menu>Setting> Environments Tab > User Defined > Attach the file

My requirement is - I have to run the same set of actions (run multiple iterations of my test scripts) using different files.
My files have
I want to automate this small piece where I can direct QTP to pick the variable file automatically and run the desired set of actions --- so for e.g.
I can do with either of 2 scenarios:

1. Decide the set of actions and just change the variable file
Action --- Make online payments using Credit Card
Run the same action for the following user defined environment variable file:
File a ......... file z

my number of iterations essentially depends on the number of files I have - so if I have to attach different files during my tests how can i do it programmatically?
Find all posts by this user
Quote this message in a reply
01-19-2012, 05:32 PM
Post: #2
Not Solved RE: programming to use different external file of environment variables
Hi,

Can you use:

Environment.LoadFromFile "c:\EnvironmentVars.xml"

Loop round changing the file path as required?

Cheers
s
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to retrieve ArrayList saved in Environment Variable Gautam26 8 449 11-07-2013 08:26 PM
Last Post: ssvali
  C# Environment property using QTP API asuteau 0 833 08-03-2012 06:51 PM
Last Post: asuteau
Exclamation How to read the contents of external excel sheet qtplearner88 10 2,598 05-25-2012 12:00 PM
Last Post: supputuri
  Array as User-Defined Environment Variables Arena 3 1,191 04-16-2012 09:19 AM
Last Post: sshukla12
  QTP file compare - ignoring file structure Fede 3 1,945 02-17-2012 02:48 AM
Last Post: Parke



User(s) browsing this thread: 1 Guest(s)