Wednesday, July 1, 2015

Creating a data driven test

1.0  Data Driving a Test

1.1       Parameterize tests

You can use the parameter feature in Quick Test to enhance your tests by parameterizing values in the test. A parameter is a variable that is assigned a value from various data sources or generators.

Two different groups of parameters:
  • Data Table parameters - parameter is taken from data table.
  • Other parameter types - parameter values are taken from random number, external user-defined file or environment variables etc.

1.1.1         Parameterize test manually


·         You can parameterize a step recorded in your test or a checkpoint added to your test.
  • You can parameterize steps and checkpoints manually by opening the appropriate dialog box.
  • You can parameterize a step in your test tree while recording or editing your test.
When you parameterize a step, you can parameterize an object property, a method argument, or both.

1.1.2         Data Table Parameters

You can supply the list of possible values for a parameter by creating a Data Table parameter.

Data Table parameters enable you to create a data-driven test that runs several times using the data you supply. In each iteration, Quick Test substitutes the constant value with a different value from the Data Table.

1.1.3         Using Environment Variable Parameters

Quick Test 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. Throughout the test run, the value of an environment variable remains the same, regardless of the number of iterations,
There are three types of environment variables:

                         1.1.3.1       User-Defined Internal


User defined internal variables are the variables that you define within the test. They are saved with the test and accessible only within the test in which they were defined.
Steps to add or modify environment variable parameters:

·         In the Edit value section of the Object Properties, Object Repository, Method Arguments, or Checkpoint Properties dialog box, click Other as the type of parameter you want to use.
·         Click the Edit Parameter Options button next to the parameter type box. The Parameter Options dialog box opens.
·         Select Environment in the Parameter Types box.
·         Accept the default name or enter a new name to add a new user-defined internal environment parameter, or select an existing environment variable name from the Name box. If you select an existing internal parameter, you can modify the value.
·         If you created a new parameter or selected an existing user-defined-internal parameter, enter the value for the parameter in the Value box.
·         Select the Regular Expression check box if needed and Enter the regular expression
·         Click OK to save your changes and close the dialog box.

                      1.1.3.2    User-Defined External

User defined external variables are the variable that you pre-defined in the active external environment variables file. You can create as many files as you want and select an appropriate file for each test. Note that external environment variable values are designated as read-only within the test.

To define these variables create an external environment variables file

To select the active external environment-variables file:
  • Choose Test > Settings to open the Test Settings dialog box.
  • Click the Environment tab.
  • Select the Load variables and values from external file (reloaded each test run) check box.
  • Use the browse button or enter the full path of the external environment- variables file you want to use with your test.

1.1.3.2        Build-in

Built-in variables, such as Test path and Operating system. They are accessible from all tests, and are designated as read-only.


1.1.4         Using Random Variable Parameters

Quick Test can insert a value from the Random variable list, which is a list of random variables and corresponding values that can be accessed from your test. if u want to pass random values for a particular test, we can  Random variable Parameters.



No comments: