UFT Test Process Part two , Types of Objects inward UFT , Types of Statements inward UFT Test
-----------------------------------------
c) Word Application Object
It is used to perform discussion application operations
Class value for creating Word Application Object- (“Word.Application”)
-------------------
d) Database Connection Object
It is used to connect to Databases
Note: Connection string alone varies from i Database to another
Class value for creating Database Connection Object- ("Adodb.Connection")
-------------------
e) Database Recordset object
It is used to perform operations on Database Tables
Class value for creating Database Recordset Object- ("Adodb.Recordset")
-------------------
f) Dictionary object
It is used to define Key, Value Pairs.
Class value for creating Dictionary Object- ("Scripting.Dictionary")
-------------------------------------------------
14) Error Handling (VBScript, UFT)
Handling expected together with unexpected Errors
Expected Error: Whenever nosotros exercise invalid input together with thence nosotros tin aspect errors
Scenarios for Unexpected Errors:
Resource Response
Availability of Resource
Insufficient Resource
Using Conditional statements
Using Built -in functions
Using Option explicit statement
Using On Error Resume Next
Using Exit Statement
Recovery Scenarios (UFT)
-------------------------------------------------------
4th Phase of UFT Test Process
-------------------------------
IV) Running together with Debugging Tests
Running Tests:
Step past times Step (Using Debug Commands)
Single Test Run (Using Run Command)
Batch Testing
Using "Test Batch Runner" Tool
Using AOM Script ("QuickTest.Application")
Using Driver Script
Using ALM Tool
Debugging Tests:
What is debugging?
When debugging is required?
Test is non showing whatsoever errors together with Not providing right output together with thence Debugging is required.
x = a * b
How to debug?
Using vbscript debug commands together with breakpoints
Important Debug Commands
Step into (F11)
Step Over (F10)
Step Out (Shift + F11)
Breakpoint (F9)
----------------------------------
5th Phase of UFT Test Process
-------------------------------
V) Analyzing Test Result
----------------------------------------
UFT Result Window
UFT Provides Test Result for every Test iteration if nosotros exercise UFT Tool features similar Checkpoints, Output values, Transaction points etc…
Define Test Result
If nosotros exercise our ain login together with thence nosotros take away to define Test Result
Using Reporter Utility Object nosotros tin define Test Result
Example:
Dim a, b
a = 100
b = 50
If a > b Then
Reporter.ReportEvent micPass, "Res1", "A is a Big Number"
Else
Reporter.ReportEvent micFail, "Res1", "B is a Big Number"
End If-------------------
Status of Test Result:
-------------------------
Pass
(If Expected = Actual)
Fail
(If Expected <> Actual)
Done
No Verification points, Test executing without Errors
Warning
Interruption during Test Execution.
----------------------------------------------------
6th Phase of UFT Test Process
-------------------------------
VI) Reporting Defects
----------------------
Functional Test Automation Defect Management
-----------------------------------------------------------
UFT Manual
--------------------------------------------------------
UFT Bugzilla/Jira
--------------------------------------------------------
UFT ALM
--------------------------------------------------------
Note: By integrating UFT amongst ALM, nosotros tin ship defects straight from UFT Result window to ALM Project.
---------------------------------------------
Types of Objects inward UFT Test Automation
---------------------------------------------
We piece of employment amongst Four types of objects inward UFT Test Automation
1) Run-time Objects
The Objects that introduce inward the Application are called Run-time Objects
States of Run-time objects:
Enabled Objects
Disabled Objects
Focused Objects
Hidden Objects
Visible Objects
------------------------------------------------------
b) Test Objects
Reference of Run-time objects are called Test Objects
Constant Objects
Dynamic Objects (handle using Regular Expressions)
Duplicate Objects (Using Index property)
Run-Time Object windows VB Web
-------------------------------------------------------------
Button WinButton VbButton WebButton
Edit box WinEdit VbEdit WebEdit
Browser NA NA Browser
Page NA NA Page
Link NA NA Link
-------------------------------------------------------------------
c) Utility Objects
UFT reserved objects used for Testing together with Result Reporting.
Ex:
SystemUtil
Windows based App
SystemUtil.Run "Path of the AUT"
Web based App
SystemUtil.Run "Path of the Browser", "URL"
Ex:
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.google.com"
---------------------------------------------
d) Automation objects
File System Object
Excel Application Object
Word Application Object
Database Connection Object
Database Recordset Object
Dictionary Object
------------------------------------------------
Types of Statements inward UFT Test / Test Script
------------------------------------------------
1) Object Calls / Test Object Statements
Ex:
Single Test Object
Syntax:
TestObject("ObjectName").Method / Operation
Ex:
Dialog("Login").Activate
Two Test Objects
Syntax:
Parent TestObject("ObjectName").Child TestObject("ObjectName").Method
Dialog("Login").WinButton("Cancel").Click
Three Test Objects
Parent TestObject("ObjectName").Child TestObject("ObjectName").Sub Chid TestObject("ObjectName").Method
Ex:
Browser("MSN Republic of Republic of India - News, Cricket,").Page("Google").Link("Gmail").Click
2) Utility Statements
----------------------
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight_service\HPFlights_Service.exe" @@ hightlight id_;_Browser("MSN Republic of Republic of India - News, Cricket,").Page("Google").Link("Gmail")_;_script infofile_;_ZIP::ssf6.xml_;_
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.gmail.com"
3) Declarations
-----------------
a) Variables
Dim a, b(4), c(), d(4, 5)
a= 10
b(0) = "India"
b(1) =100
b(2) =10.345
b(3) =#10/10/2010#
b(4) =123
d(0, 0) = "VBScript"
b) Constants
Const metropolis ="London", num = 100
4) Flow Control Statements
--------------------------
a) Conditional Statements
Ex:
Dim a, b
a= 100
b= 20
If a > b Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
---------------
b) Loop Statements
For i = 1 To v Step 1
Msgbox i & " Hello UFT"
Next
5) Action Calls, Function Calls
--------------------------------
Ex:
Call Login()
6) Checkpoint Statements
------------------------
Window("Flight Reservation").WinEdit("Tickets:").Check CheckPoint("Tickets:")
7) Output Value Statements
-------------------------
Window("Flight Reservation").WinEdit("Name:").Output CheckPoint("Name:")
8) VBScript Statements
--------------------
Set
Dim
Constant
For
Etc....
9) Automation Objects Statements
--------------------------------
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.ActiveWorkbook.SaveAs "C:\Users\gcreddy\Desktop\QTP.xls"
----------------------------------------------------------------
Sumber http://www.gcreddy.com/
-----------------------------------------
c) Word Application Object
It is used to perform discussion application operations
Class value for creating Word Application Object- (“Word.Application”)
-------------------
d) Database Connection Object
It is used to connect to Databases
Note: Connection string alone varies from i Database to another
Class value for creating Database Connection Object- ("Adodb.Connection")
-------------------
e) Database Recordset object
It is used to perform operations on Database Tables
Class value for creating Database Recordset Object- ("Adodb.Recordset")
-------------------
f) Dictionary object
It is used to define Key, Value Pairs.
Class value for creating Dictionary Object- ("Scripting.Dictionary")
-------------------------------------------------
14) Error Handling (VBScript, UFT)
Handling expected together with unexpected Errors
Expected Error: Whenever nosotros exercise invalid input together with thence nosotros tin aspect errors
Scenarios for Unexpected Errors:
Resource Response
Availability of Resource
Insufficient Resource
Using Conditional statements
Using Built -in functions
Using Option explicit statement
Using On Error Resume Next
Using Exit Statement
Recovery Scenarios (UFT)
-------------------------------------------------------
4th Phase of UFT Test Process
-------------------------------
IV) Running together with Debugging Tests
Running Tests:
Step past times Step (Using Debug Commands)
Single Test Run (Using Run Command)
Batch Testing
Using "Test Batch Runner" Tool
Using AOM Script ("QuickTest.Application")
Using Driver Script
Using ALM Tool
Debugging Tests:
What is debugging?
When debugging is required?
Test is non showing whatsoever errors together with Not providing right output together with thence Debugging is required.
x = a * b
How to debug?
Using vbscript debug commands together with breakpoints
Important Debug Commands
Step into (F11)
Step Over (F10)
Step Out (Shift + F11)
Breakpoint (F9)
----------------------------------
5th Phase of UFT Test Process
-------------------------------
V) Analyzing Test Result
----------------------------------------
UFT Result Window
UFT Provides Test Result for every Test iteration if nosotros exercise UFT Tool features similar Checkpoints, Output values, Transaction points etc…
Define Test Result
If nosotros exercise our ain login together with thence nosotros take away to define Test Result
Using Reporter Utility Object nosotros tin define Test Result
Example:
Dim a, b
a = 100
b = 50
If a > b Then
Reporter.ReportEvent micPass, "Res1", "A is a Big Number"
Else
Reporter.ReportEvent micFail, "Res1", "B is a Big Number"
End If-------------------
Status of Test Result:
-------------------------
Pass
(If Expected = Actual)
Fail
(If Expected <> Actual)
Done
No Verification points, Test executing without Errors
Warning
Interruption during Test Execution.
----------------------------------------------------
6th Phase of UFT Test Process
-------------------------------
VI) Reporting Defects
----------------------
Functional Test Automation Defect Management
-----------------------------------------------------------
UFT Manual
--------------------------------------------------------
UFT Bugzilla/Jira
--------------------------------------------------------
UFT ALM
--------------------------------------------------------
Note: By integrating UFT amongst ALM, nosotros tin ship defects straight from UFT Result window to ALM Project.
---------------------------------------------
Types of Objects inward UFT Test Automation
---------------------------------------------
We piece of employment amongst Four types of objects inward UFT Test Automation
1) Run-time Objects
The Objects that introduce inward the Application are called Run-time Objects
States of Run-time objects:
Enabled Objects
Disabled Objects
Focused Objects
Hidden Objects
Visible Objects
------------------------------------------------------
b) Test Objects
Reference of Run-time objects are called Test Objects
Constant Objects
Dynamic Objects (handle using Regular Expressions)
Duplicate Objects (Using Index property)
Run-Time Object windows VB Web
-------------------------------------------------------------
Button WinButton VbButton WebButton
Edit box WinEdit VbEdit WebEdit
Browser NA NA Browser
Page NA NA Page
Link NA NA Link
-------------------------------------------------------------------
c) Utility Objects
UFT reserved objects used for Testing together with Result Reporting.
Ex:
SystemUtil
Windows based App
SystemUtil.Run "Path of the AUT"
Web based App
SystemUtil.Run "Path of the Browser", "URL"
Ex:
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.google.com"
---------------------------------------------
d) Automation objects
File System Object
Excel Application Object
Word Application Object
Database Connection Object
Database Recordset Object
Dictionary Object
------------------------------------------------
Types of Statements inward UFT Test / Test Script
------------------------------------------------
1) Object Calls / Test Object Statements
Ex:
Single Test Object
Syntax:
TestObject("ObjectName").Method / Operation
Ex:
Dialog("Login").Activate
Two Test Objects
Syntax:
Parent TestObject("ObjectName").Child TestObject("ObjectName").Method
Dialog("Login").WinButton("Cancel").Click
Three Test Objects
Parent TestObject("ObjectName").Child TestObject("ObjectName").Sub Chid TestObject("ObjectName").Method
Ex:
Browser("MSN Republic of Republic of India - News, Cricket,").Page("Google").Link("Gmail").Click
2) Utility Statements
----------------------
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight_service\HPFlights_Service.exe" @@ hightlight id_;_Browser("MSN Republic of Republic of India - News, Cricket,").Page("Google").Link("Gmail")_;_script infofile_;_ZIP::ssf6.xml_;_
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.gmail.com"
3) Declarations
-----------------
a) Variables
Dim a, b(4), c(), d(4, 5)
a= 10
b(0) = "India"
b(1) =100
b(2) =10.345
b(3) =#10/10/2010#
b(4) =123
d(0, 0) = "VBScript"
b) Constants
Const metropolis ="London", num = 100
4) Flow Control Statements
--------------------------
a) Conditional Statements
Ex:
Dim a, b
a= 100
b= 20
If a > b Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
---------------
b) Loop Statements
For i = 1 To v Step 1
Msgbox i & " Hello UFT"
Next
5) Action Calls, Function Calls
--------------------------------
Ex:
Call Login()
6) Checkpoint Statements
------------------------
Window("Flight Reservation").WinEdit("Tickets:").Check CheckPoint("Tickets:")
7) Output Value Statements
-------------------------
Window("Flight Reservation").WinEdit("Name:").Output CheckPoint("Name:")
8) VBScript Statements
--------------------
Set
Dim
Constant
For
Etc....
9) Automation Objects Statements
--------------------------------
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.ActiveWorkbook.SaveAs "C:\Users\gcreddy\Desktop\QTP.xls"
----------------------------------------------------------------