Load UFT Environment Variable File
How to Load UFT Environment Variable Files?
There are two ways to load Environment Variable Files in UFT:
1. Load an Environment Variable File from the test settings.
Go to "Files > Settings > Environment > User-Defined".
Check "Load variable and values from external file" option, and click the browse button locate and load the Environment Variable File.
2. Load an Environment Variable File with the Environment.LoadFromFile(file_name) method in the test script code.
Here are some example codes that loads an Environment Variable File:
environment.LoadFromFile("C:\\fyicenter\\UFT\\env.xml") ' Loads an Environment Variable File with absolute file path. environment.LoadFromFile(".\\env.xml") ' Loads an Environment Variable File with relative file path.
Loading Environment Variable Files with relative file path in test script code is the best option. It makes your test more explicit and easy to be moved around.
2018-01-24, 506👍, 0💬
How to encode a URL string? URL encoding is an Internet standard defined in RFC1738 to protect speci...
What are date and time test values? Date and time test values are frequently needed in testing date ...
How to perform Base64 Decoding? Base64 encoding is designed to convert any digital data into 64 prin...
How to generate test phone numbers? Test phone numbers are frequently needed in testing applications...
How to generate user birthday dates? Test user birthday dates are frequently needed in testing appli...