Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Tuesday, 23 April 2019

Parameterization in UFT/QTP

1. What is Parameter and Prameterization ...?

A parameter like variable which contains a value. The value of the parameter can be assigned by the internal/external data source or generator.

Parameterization is the process of replacing the values with Parameters. When we replace the values with parameters, the test can have the facility of Data driving. 

2. What is difference between Parameterization and Data driving ...?

Parameterization enables to do data driving for a script. Running a script with different sets of data is called as Data Driving. Once a test is parameterized, we can run it by using different sets of data from external data sources like a excel sheets. This is called a data driven test.

3. Explain Types in Parameterization ...?

There are 4 types of Parameters

1. Datatable Parameters:  UFT has an in built Datatable which is used to store or retrieve values from, to script. Using Datatable parameters are useful to store or retrieve values from Datatable. We can even import external data to data table for later use in the script. This parameterization type is mainly used for DataDriven testing. 

2. Action Parameters: A Reusable Action can be called from another Action. We can send/retrieve values from, to the Action while calling it. For this Action Parameters are useful. 
Action Parameters are of two types.

a. Input Action Parameters: Useful to send values to an Action while calling it from other Actions.

b.Output Action Parameters: Useful to retrieve values from an Action while calling it from other Actions. 

3. Environment Parameters: Environment Parameters give environment information of UFT/QTP like what is the current OS, Current Test Name and current logged user ... etc.

Environment Parameters are useful to set the global values for a project or test. There are two types in Environment Parameters.

a. Built-in Environment Parameters: These are defined by UFT, and will have environment details of UFT.

b. User Defined Environment Parameters: These should be defined by a user, as a standard user will define application related environment like current execution environment , URL of the application ... etc..

User defined environment variables can be stored in outside of UFT. Those are called as external user defined environment variable.

4. RandomNumber Parameters: These are useful to generate random numbers between a specific range. The Random numbers can be generated for each Action or Test Iteration.

4. What Parameterization Types are useful for Data driven testing ..?

Datatable Parameterization is useful to data driven testing. Because we can send multiple rows of data from excel sheets by importing them in UFT. 

5. How do you parameterize the Data with External Data Sheet  .?


By importing that sheets to UFT, we can parameterize External Data sheet.


6. How do you prepare Data Driven Tests ... ?


After developing the script I Will parameterize  the data with datatable Parameters. I will import the data from an external data sheet and use that data in script. By this we can execute the test with multiple rows of test data.


7. How can you Export/Import Environment Variables ...?


Environment variables can be imported/exported from Test settings dialog.


Go to File-->Settings--->Environment--->Variable Type: User Defined. Here we can define environment variables by clicking on Add(+) button. After Adding Environment variables we can export them by clicking on export button. 



Using load variables and values from external file operation, we can specify external environment variable.

8. What type of data can be sent from one action to another... ?


We can send only below data types from one action to another. 

1. String 
2. Boolean
3. Date
4. Number
5. Password

9. How to send data from one action to another .. ?


We can use multiple techniques for  this.


Using Action Parameters: We can send values between actions but in order to perform this the action should be called from anothr action. 


Using Environment Parameters: The environment variables are global and we can create the environment variables and store the values in runtime. So we can directly access the values from one action to another without calling it. 


Using Data table parameters: The data table parameters are useful to store and retrieve values. We can store the values of one action and retrieve the same values from another action in runtime without calling an action from another. 


10. What type of data can be send between Actions ... ?


Using action/datatable parameters we can send only fixed values. But using the Environment parameters we can send any type of data between Actions.