Parametrize through environment

How to parametrize through environment. Please use a suitable example.

Questions by geekarijit

Showing Answers 1 - 0 of 0 Answers

Environment parameters are especially useful for localization testing, when you want to test an application where the user interface strings change, depending on the selected language. Environment parameters can be used for testing the same application on different browsers. You can also vary the input values for each language by selecting a different Data Table file each time you run the test.

Quick Tests can insert a value from the Environment variable list, which is a list of variables and corresponding values that can be accessed from your test. Throughtout the test run, the value of an environment variable remains the same, regardless of the number of iterations, unless the change the value of the cariable programmatically in scripts.

There are three types of environment variables

->User Defined Internal: Variables that you define within the test. These variables arre saved with the test and are accessible only within the test in which they were defined.

You can create or modify internal, user-defined environment cariables for your test in the environment tab of the Test settings dialog or in the Parameter Options dialog box.

-> User-Defined External-Variables that you predefine in the active external envronment variables file. You can create as many files as you want and select an appropriate file for each test, or change files for eachtest run. Note that external environment variable values are designated as read-only within the test

->Built-In- Variables that represent information about the test and the computer on which the test is run, such as test path and Operating system. These variables are accessible from all tests and components, and are designates as read-only.

Just a add on...

You can also put all common variables  in an external xml file  and import  it  into  the  QTP  to be used  across all  tests.

The structure  of  XML  file would be:

<Environment>
<Var1>
<name>Number</name>
<value>20</value>
</Var1>
</Environment>

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions