UFT Parameterization
What is Parameterization?
Replacing constant (fixed) values amongst parameters is called Parameterization.
-----------------------------------------
Purpose of Parameterization
To croak multiple values
To croak unmarried value
----------------------------------------------
What is Data driven Testing?
Testing the same functionality using multiple sets of exam data.
----------------------------------------------------
Why Data Driven Testing?
For Positive as well as Negative Testing
--------------------------------------------------
Relation betwixt Parameterization as well as Data driven testing
We usage Parameterization characteristic inwards Data driven Testing.
------------------------------------------
How to Parameterize?
We tin usage either variables or Constants or Arguments or Action Parameters or Data Table parameters or Environment variables or Dictionary object keys every bit parameters.
---------------------------------------
Ways of Parameterization
i) Generate as well as croak values using Loop statements
ii) Dynamic Test information submission
iii) Using Data Table
a) Enter Test information bespeak into information tabular array as well as connect to the Test.
b) Import Test information from external files (Text or Excel) into information tabular array as well as connect to the Test.
c) Import Test information from a Database into information tabular array as well as connect to the Test.
iv) Using Action Parameters
v) Using Function Arguments
vi) Using Environment Variables
vii) Using Dictionary object
viii) Using Automation Objects
a) Read exam information bespeak from a text file as well as connect
b) Read exam information bespeak from an Excel file as well as connect
c) Read exam information bespeak from a Database as well as connect
--------------------------------------------------------------------
i) Generate as well as croak values using Loop statements
Using Loop statements nosotros tin generate or thence types of data
a) We tin generate Sequential numbers (ex: 1, 2, 3..../23, 24, 25...)
b) We tin generate Logical numbers (ex: 2, 4, 6.../1, 3, 5.../10, 20, 30....)
---------------------
a) We can't generate desired numbers (ex: 1, 7, 23, 45.....)
b) We can't generate String type information (ex: User name, Customer name, Password etc....)
---------------------------------------------
'Open 1 to v orders
For OrderNumber = 1 To v Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
------------------------------------------
'Open fifty-fifty orders upwards to 10
For OrderNumber = 2 To ten Step 2
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
--------------------------------------------
'Open outset v orders inwards opposite order
For OrderNumber = v To 1 Step -1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
-------------------------------------------
'Open outset v orders except fourth order
For OrderNumber = 1 To v Step 1
If Not OrderNumber = four Then
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
End If
Next
--------------------------------------------------------
'Open outset ten orders except fourth as well as seventh orders
For OrderNumber = 1 To ten Step 1
If OrderNumber <> four And OrderNumber <> seven Then
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
End If
Next
------------------------------------------------------------
ii) Dynamic Test information submission
using this characteristic Tester tin furnish all types of Data.
But it is non recommendable for large total of exam data.
---------------------------------------------
For i = 1 To three Step 1
Agent = InputBox("Enter Agent Name")
Password = InputBox("Enter Password")
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe","","C:\Program Files\HP\Unified Functional Testing\samples\flight\app\",""
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set Agent
Dialog("Login").WinEdit("Password:").Set Password
wait 2
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
Next
-------------------------------------------`
For captcha fields it is useful feature.
---------------------------------------------------
iii) Using Data Table
a) Enter Test information bespeak into information tabular array as well as connect to the Test.
b) Import Test information from external files (Text or Excel) into information tabular array as well as connect to the Test.
c) Import Test information from a Database into information tabular array as well as connect to the Test.
-----------
Steps for Data Driven Testing using Data Table
------------------------------
a) Generate the basic Test as well as run it once.
b) Launch Data Table as well as Enter / Import Test data
c) Connect Test information amongst the Test.
(Using Editor View or Using Keyword sentiment or using Data driver)
d) Run the Test
------------------------------------------------
Syntax:
DataTable(Column elevate / Column ID, Sheet elevate or Sheet Id)
Example:
--------------
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe","","C:\Program Files\HP\Unified Functional Testing\samples\flight\app\",""
Dialog("Login").WinEdit("Agent Name:").Set DataTable(1, 1)
Dialog("Login").WinEdit("Password:").Set DataTable(2, 1)
wait 2
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
-------------------------------------------------
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe","","C:\Program Files\HP\Unified Functional Testing\samples\flight\app\",""
Dialog("Login").WinEdit("Agent Name:").Set DataTable("Agent", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable("Password", dtGlobalSheet)
wait 2
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
-----------------------------------------------------
We tin usage Text files or Excel files every bit Resource files.
If nosotros usage Text file every bit Resource as well as thence 2 syntax rules:
i) Data Table considers Text file outset business every bit Field headers
ii) Tab infinite is the delimiter inwards betwixt 2 fields
------------------------------------
If nosotros usage Excel file every bit Resource as well as thence only 1 syntax rule:
i) Data Table considers Excel file outset Row every bit Field headers
------------------------------------------------------------------
c) Import Test information from a Database into information tabular array as well as connect to the Test.
Steps:
i) Create a database
ii) Create tables
iii) Enter Test data
------------------
iv) Create DSN (data rootage Name)
v) Fetch Test information using SQL commands.
Sumber http://www.gcreddy.com/
What is Parameterization?
Replacing constant (fixed) values amongst parameters is called Parameterization.
-----------------------------------------
Purpose of Parameterization
To croak multiple values
To croak unmarried value
----------------------------------------------
What is Data driven Testing?
Testing the same functionality using multiple sets of exam data.
----------------------------------------------------
Why Data Driven Testing?
For Positive as well as Negative Testing
--------------------------------------------------
Relation betwixt Parameterization as well as Data driven testing
We usage Parameterization characteristic inwards Data driven Testing.
------------------------------------------
How to Parameterize?
We tin usage either variables or Constants or Arguments or Action Parameters or Data Table parameters or Environment variables or Dictionary object keys every bit parameters.
---------------------------------------
Ways of Parameterization
i) Generate as well as croak values using Loop statements
ii) Dynamic Test information submission
iii) Using Data Table
a) Enter Test information bespeak into information tabular array as well as connect to the Test.
b) Import Test information from external files (Text or Excel) into information tabular array as well as connect to the Test.
c) Import Test information from a Database into information tabular array as well as connect to the Test.
iv) Using Action Parameters
v) Using Function Arguments
vi) Using Environment Variables
vii) Using Dictionary object
viii) Using Automation Objects
a) Read exam information bespeak from a text file as well as connect
b) Read exam information bespeak from an Excel file as well as connect
c) Read exam information bespeak from a Database as well as connect
--------------------------------------------------------------------
i) Generate as well as croak values using Loop statements
Using Loop statements nosotros tin generate or thence types of data
a) We tin generate Sequential numbers (ex: 1, 2, 3..../23, 24, 25...)
b) We tin generate Logical numbers (ex: 2, 4, 6.../1, 3, 5.../10, 20, 30....)
---------------------
a) We can't generate desired numbers (ex: 1, 7, 23, 45.....)
b) We can't generate String type information (ex: User name, Customer name, Password etc....)
---------------------------------------------
'Open 1 to v orders
For OrderNumber = 1 To v Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
------------------------------------------
'Open fifty-fifty orders upwards to 10
For OrderNumber = 2 To ten Step 2
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
--------------------------------------------
'Open outset v orders inwards opposite order
For OrderNumber = v To 1 Step -1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
-------------------------------------------
'Open outset v orders except fourth order
For OrderNumber = 1 To v Step 1
If Not OrderNumber = four Then
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
End If
Next
--------------------------------------------------------
'Open outset ten orders except fourth as well as seventh orders
For OrderNumber = 1 To ten Step 1
If OrderNumber <> four And OrderNumber <> seven Then
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
End If
Next
------------------------------------------------------------
ii) Dynamic Test information submission
using this characteristic Tester tin furnish all types of Data.
But it is non recommendable for large total of exam data.
---------------------------------------------
For i = 1 To three Step 1
Agent = InputBox("Enter Agent Name")
Password = InputBox("Enter Password")
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe","","C:\Program Files\HP\Unified Functional Testing\samples\flight\app\",""
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set Agent
Dialog("Login").WinEdit("Password:").Set Password
wait 2
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
Next
-------------------------------------------`
For captcha fields it is useful feature.
---------------------------------------------------
iii) Using Data Table
a) Enter Test information bespeak into information tabular array as well as connect to the Test.
b) Import Test information from external files (Text or Excel) into information tabular array as well as connect to the Test.
c) Import Test information from a Database into information tabular array as well as connect to the Test.
-----------
Steps for Data Driven Testing using Data Table
------------------------------
a) Generate the basic Test as well as run it once.
b) Launch Data Table as well as Enter / Import Test data
c) Connect Test information amongst the Test.
(Using Editor View or Using Keyword sentiment or using Data driver)
d) Run the Test
------------------------------------------------
Syntax:
DataTable(Column elevate / Column ID, Sheet elevate or Sheet Id)
Example:
--------------
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe","","C:\Program Files\HP\Unified Functional Testing\samples\flight\app\",""
Dialog("Login").WinEdit("Agent Name:").Set DataTable(1, 1)
Dialog("Login").WinEdit("Password:").Set DataTable(2, 1)
wait 2
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
-------------------------------------------------
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe","","C:\Program Files\HP\Unified Functional Testing\samples\flight\app\",""
Dialog("Login").WinEdit("Agent Name:").Set DataTable("Agent", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable("Password", dtGlobalSheet)
wait 2
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
-----------------------------------------------------
We tin usage Text files or Excel files every bit Resource files.
If nosotros usage Text file every bit Resource as well as thence 2 syntax rules:
i) Data Table considers Text file outset business every bit Field headers
ii) Tab infinite is the delimiter inwards betwixt 2 fields
------------------------------------
If nosotros usage Excel file every bit Resource as well as thence only 1 syntax rule:
i) Data Table considers Excel file outset Row every bit Field headers
------------------------------------------------------------------
c) Import Test information from a Database into information tabular array as well as connect to the Test.
Steps:
i) Create a database
ii) Create tables
iii) Enter Test data
------------------
iv) Create DSN (data rootage Name)
v) Fetch Test information using SQL commands.