Tuesday, 22 September 2015

Parameterization

We can use the parameter feature in Quick test to enhance our test by parameterizing the values that it uses. A parameter is a variable that is assigned a value from an external data source such as XL sheets .Word docs etc.The re-execution of single script with multiple data is called parameterization or data driven testing. There are following ways to parameterize

  • Test\check Parameter
  • Data driven Parameter
  • Environment Variable Parameter
  • Random Parameter 
Test\Check Parameterization:

Sequetially:
Test parameter enable testers to use values passed from keyboard by writing for....next loop statement
"for---next " loop instructs Quick test to perform one or more statements a specified number of times. It has the following syntax.
Syntax : 
For counter = start to end [step steno]
vbScript statement 
Next
Example :
For i=1 to 3 Step1
Window("Flight Reservation").WinMenu("Menu").Select"File;Open Order...."
Window("Flight Reservation").Dialog ("Open Order").WinCheckbox("order No.").Set "ON"
Window ("Flight Reservation").Dialog("Open Order").Winedit("edit").Set X
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
Randomly:
During randomly execution, testers dynamically submit specific values from keyboard. In this execution. Testers use "Input Box" function to execution on specific value. It has the following syntax.
Syntax:
For Counter= Start to end [step Steno]
X= Input box ("string ", Title ).
VbScript Statement 
Next
Example:
For i= 1 to 3
X= Input box("enter order no',"order no")
window
Next. 
Data Driven Parameter:
Enable testers to create a data driven test, that runs several times using the data which is maintain in external documents such as data sheet. In each repetition , or iteration Quick Test uses a different value from the data table. There are value from the data table. There re different ways to data driven test

  • DDT with test data by maintaining in DataTable 
  • DDT with the test data by import from external sheets 
  • DDT with the test data from Database 
  • DDT with test data from Keyword
DDT with test data by maintaining in DataTable:

During this, testers are creating appropriate script maintain test data in to the data table and with the help of data driver tool. Paramerize the data to the script . So that the QTP will execute that script on the application for number of times.
DDT with the test data by import from external sheets:
During this, testers are creating appripriate script by importing test data from other excel sheets into QTP data sheet table with the help of Data drive tool. They parametrize the data to the script. So that the QTP will execute that script on the application for number of times.
DDT with the test data from Database :
During this, testers are creating appropriate script by importing test data from database into QTP Data Table with the help of Data Drive tool. They parameterize the data to the script. So that the QTP will execute the script on the application for number of times
DDT with test data from Keyword:
During this testers are creating appropriate Script maintain data into QTP . Data table an without using data driver tool, Parameterize the data to the script, so  that QTP will execute that script on the application for number of times.



No comments:

Post a Comment