Monday, 19 October 2015

Recording in UFT

Recording:

·         Normal Context-Default Recording
·         Analog-Mouse Movements, record the tracks of mouse movements in single line(no steps)
·         Low-Level-doesnot record mouse movements- cor-ordinates
·         Insight-UFT record on appearance not on native property

Data Driven Testing using vb script UFT

Find below the code for DDT

First, we have to create object of "excel.application"
Then we have to use this object for performing various functions.



Set oExcel=createobject("excel.application")
Set oExcelWorkbook=oExcel.Workbooks.Open("D:\DataSheet\Datasheet.xls")
Set OExcelSheet=oExcelWorkbook.Worksheets("DataSheet")
oExcelCount=OExcelSheet.usedrange.rows.count

For i=2 to oExcelCount
  user= OExcelSheet.cells(i,1)
' msgbox user
 password= OExcelSheet.cells(i,2)
' msgbox password
print user
print password
Next

oExcel.Workbooks.Close

Thursday, 15 October 2015

Synchronization

Synchronization:

file-setting-run-object synchronization time for synchronization
Object synchronization-20 seconds. Page snchronization default time 60 seconds

1. sync- used for page navigation
2. wait- explicit wait
3. waitproperty- direct and condition (mostly used to check enabled disabled) millisecond
4. exist- on condition only (used with if condition)second

Used to control the execution of script according to the application. Script default time 20 second
·         Sync: browser navigation (default time 60 second)
·         Wait: (default time)-static
·         Waitproperty: (millisecond) dynamic wait. Can be defined only on object and we need to validate any property []

·         Exist: (seconds) used for condition, dynamic [icici example]

Random Number

a=now
b=replace(a,"-","")
c=replace(b," ","")
d= replace(c,":","")
msgbox d

Parameterization

Parameterization:

1. Datatable
2. Environment Variable
3. Action Parameter-right click on action-properties- action parameter
.Set parameter("user")
4. Random Variable

Object Repository

Object Repository:

1. Local-by default is local .mtr
2. Shared- performance, security and maintenance
Also called as User Defined repository.
.tsr
to merge resources-OR-tools-merge tool
associate repository

Object Repository:

Feature in QTP where objects are stored
·         Local(mtr-Mercury Test Repository)-By Default
·         Shared(tsr-Test Shared Repository)-User Defined
Covert Local to Shared:
·         Save local repository. It will be in .tsr format i.e. shared

·         Goto resources –or manager-click ->tools->OR Merge Tool->Enable Editing->Browser name should be same for all the pages in all actions

Object Identification Mechanism

Object Identification Mechanism

1. Mandatory Property
 -Description Property in QTP- combination of Mandatory and Assistive Property
2. Assistive Property
3. Ordinal dentifier- if qtp not able to identify object using mandatory and assistive property then it goes for ordinal property
1.Location
2.Index- when properties of two objects are same then it goes for index(starts with zero)
3.Creation Time- used for brwoser- if 3 browsers are opened, it will perform action on 1st
browser("CreationTime:=1").Close
4. Smart Identification- It is technique to identify object with combination of two filter properties:
base filter property
optional filter property

local setting-individual-
tools-object identification-web-select button-Global Setting
file -setting-run-disable smart identification during run session

Object Identification Mechanism:
·         Mandatory property:
·                     Frame
·                     Name
·                     Browser, page
·                     None
·                     Web Table
·                     HTML Tag
·                     WebList, WebRadioGroup
·                     HTML tag ,Name
·                     WebButton WebFile WebEdit WebCheckbox
·                     HTML tag ,Name,Type
·                     ViewLInk WebElement
·                     HTML tag ,Inner Text
·                     Web Area
·                     HTML tag ,Alt(tool tip)
·                     Image
·                     HTML tag ,Alt, Image Type

·         Assistive: e.g Name in WebEdit
·         Ordinary identifier:
Location X,Y
 Creation time: used for browser
Indexing- t overcome Location drawbacks

·         Smart Identification: inbuilt feature to recognize object
Base filter properties(Mandatory & Assistive)
Optional Filter properties(Ordinary identifier)