UFT Tutorial 8 - Keyword Driven Methodology


UFT Tutorial 8: Keyword Driven Methodology
 

Generating Tests Manually using keywords (Test object, Utility object, method etc...)

Steps for Keyword Driven Methodology:
 

i) Create shared object Repositories (Add Objects or export local objects)

ii) Associate shared object Repositories

Or

Load Shared object Repositories at run-time.

iii) Generate Steps

    a) Using Editor view

    b) Using Keyword view

    c) Using Step Generator

    d) By drag and drop objects from OR to Editor (Test Object steps only)
-------------------------------------
Step Generator
 

Design -> Step Generator or (F7)

It is a library of Functions (VBScript built-in functions etc...) and Utility objects, used to generate Recordable and Non-Recordable steps.

Non-Recordable steps:
 

i) Operation on disabled Object

ii) Irregular Operation
------------------------------------------
Advantages of Recording
 

i) Easy to generate Tests and takes less time.

ii) Scripting is knowledge optional

iii) Analyze the AUT in terms of Object Identification.

iv) Recommendable for dynamically changing UI designs

v) Recommendable for short term projects
etc...
-------------------------------
Disadvantages of Recording
 

i) No centralized maintenance of Test Objects

ii) Low in performance.

iii) Testers may not have command on Test scripts, so locating errors is difficult

iv) We cannot record all operations

etc...
-------------------------------------
Types of Steps or Statements in UFT Test / test script
 

We use different type of steps in UFT Tests

i) Utility statements / Steps
 

SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
 

SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe"

ii) Test Object Statements or Object Calls
 

Browser("Google").Page("Google").Link("Gmail").Click
WpfWindow("HP MyFlight Sample Application").WpfButton("Cancel").Click
iv) Declarationsa) Variables
Dim a, b(4), c(), d(4, 5)

b) Constants
Const city ="Hyderabad", num =100

iv) Flow Control Statements
a) Conditional Statements
 

Dim a, b

a =100
b = 50

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 5 Step 1
Msgbox i &    " Hello UFT"
Next

v) Checkpoint Statements
 

VbWindow("CALCULATOR").VbEdit("RESULT").Check CheckPoint("RESULT")

vi) Output value statements
 

VbWindow("CALCULATOR").VbEdit("RESULT").Output CheckPoint("RESULT")

vii) Automation Object statement
 

objFso.CreateFolder "C:\Users\G C REDDY\Desktop\QTP"

viii) VBScript statements
 

Option Explicit

Dim

If

Set

On Error Resume Next etc...
------------------------------------

No comments:

Post a Comment