Tuesday, July 2, 2019

12 Parameterization - 1 - Basics


Parameterization Basics

What is a parameter?

A parameter is a variable used to denote or represent data in our tests.

Why do we parameterize?

We do parameterization when we want multiple sets of data to be used for the same set of operations.
Suppose we want to automate an application for Localization Testing. We can use the same code and parameterize the input data for the application steps and import the different data for different language from different data table or excel file for each language.
In another example, we can use parameterization for input values for an application with same set of test data as input data. When we have one application as Web and another as Windows with same business flows.


What do we parameterize?

We use parameterization for the below reasons -:

      1. Checkpoints
      2. Object Properties for a selected step.
      3. Object Properties in the Object Repository.
      4. Operation arguments for a selected step.


What are the different types of Parameterization available in UFT?

The different types of parameterization available in UFT are -:

      1. Test and Action Parameterization.
      2. Data Table Parameterization.
      3. Environment Variable Parameterization.
      4. Random Number Parameterization.

What are the different types of Test Parameterization?

The different types of Test Parameterization are -:

      1. Input Parameterization
      2. Output Parameterization
Both the parameterization information can be added from the related Test Properties Pane.
In the Properties Pane – Parameterization tab we have options to -:

a) Add – Input/Output Parameter
b) Edit – edit information related to added parameters such as Name, Value and Type of parameter.
c) Delete – delete a parameter.
We can use these parameter values to pass to the actions present in the test and also to other tests in the same Solution.


What is Action Parameterization?

The different types of Action Parameterization are -:

        1. Input Parameterization
        2. Output Parameterization
Both the parameterization information can be added from the related Action Properties Pane.
In the Properties Pane – Parameterization tab we have options to -:

a) Add – Input/Output Parameter
b) Edit – edit information related to added parameters such as Name, Value and Type of parameter.
      1. Delete – delete a parameter.


What are the different types of Parameterization through Environment Variables?

The different types of Environment Variables are -:

      1. User-Defined Internal Environment Variables
      2. User-Defined External Environment Variables
      3. In-Built Environment Variables.


User-Defined Internal Environment Variables

In the case of User-Defined Internal Environment Variables we can set up variables from the FILE Menu-Settings option-Environment tab.
We can add the environment variables by giving the name and value of the variable from the above pane.
We can also export the User-Defined Environment variable to an XML file from the menu.


User-Definned External Environment Variables

In the case of User-Defined External Environment variable we can create an external XML file in the format accepted by UFT and import the created XML file to UFT with the options present in the menu. The XML file format should start as -:

<Environment>
<Variable>
<Name>VariableName1<\Name>
<Value>VariableValue1<\Value>
<Description>Variable Description1<\Description>
<\Variable>
<Variable>
<Name>VariableName1<\Name>
<Value>VariableValue1<\Value>
<Description>Variable Description1<\Description>
<\Variable>
<\Environment>


UFT In-Built Environment Variables

There are multiple built-in environment variables in UFT which consist of information related to the test. These are variables such as OS Name and Test Name. We can use these environment variables in our code to check with an IF structure and run the required code.


What is the Data Driver?

Data Driver in UFT is used to quickly parameterize several or all occurrences of a property of a test object, checkpoint property and method argument when they have multiple occurrences of a constant in the action.
Data Driver functions like Find and Replace All in excel.

No comments:

Post a Comment